Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-07-19 10:50:52 +0000
committerEike Stepper2009-07-19 10:50:52 +0000
commit6e9da438713b73fae130737624b01cead345bb4c (patch)
tree86a05d056d22aa9dc89aabc8b24e5f67c720b180 /plugins/org.eclipse.emf.cdo
parent4f348b1e67b7ac6be096f7f94c4260c88cf06489 (diff)
downloadcdo-6e9da438713b73fae130737624b01cead345bb4c.tar.gz
cdo-6e9da438713b73fae130737624b01cead345bb4c.tar.xz
cdo-6e9da438713b73fae130737624b01cead345bb4c.zip
[283945] Prevent EObjects from being passed to a repository
https://bugs.eclipse.org/bugs/show_bug.cgi?id=283945
Diffstat (limited to 'plugins/org.eclipse.emf.cdo')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 3f29730dc4..960954773c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -507,7 +507,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
Object value = folderRevision.data().get(nodesFeature, i);
value = getStore().resolveProxy(folderRevision, nodesFeature, i, value);
- CDORevision childRevision = getLocalRevision((CDOID)convertObjectToID(value, false));
+ CDORevision childRevision = getLocalRevision((CDOID)convertObjectToID(value));
if (name.equals(childRevision.data().get(nameFeature, 0)))
{
return childRevision.getID();
@@ -978,21 +978,25 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
return potentialObject;
}
- private CDOID getID(InternalCDOObject object, boolean onlyPersistedID)
+ protected CDOID getID(InternalCDOObject object, boolean onlyPersistedID)
{
- boolean newOrTransient = FSMUtil.isTransient(object) || FSMUtil.isNew(object);
- if (!(onlyPersistedID && newOrTransient))
+ if (onlyPersistedID)
{
- CDOView view = object.cdoView();
- if (view == this)
+ if (FSMUtil.isTransient(object) || FSMUtil.isNew(object))
{
- return object.cdoID();
+ return null;
}
+ }
- if (view != null && view.getSession() == getSession())
- {
- return object.cdoID();
- }
+ CDOView view = object.cdoView();
+ if (view == this)
+ {
+ return object.cdoID();
+ }
+
+ if (view != null && view.getSession() == getSession())
+ {
+ return object.cdoID();
}
return null;

Back to the top