Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-07-22 09:11:58 +0000
committerEike Stepper2009-07-22 09:11:58 +0000
commit3161e569d42ca254be25aa5f1ebf37daa43993fa (patch)
tree020431ab44faf7c4d14f32687f182608d8f98032
parenta666194498356811e87bebbe39d44e0cb8192f2b (diff)
downloadcdo-3161e569d42ca254be25aa5f1ebf37daa43993fa.tar.gz
cdo-3161e569d42ca254be25aa5f1ebf37daa43993fa.tar.xz
cdo-3161e569d42ca254be25aa5f1ebf37daa43993fa.zip
[283945] Prevent EObjects from being passed to a repository
https://bugs.eclipse.org/bugs/show_bug.cgi?id=283945
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOIDDanglingImpl.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDORevisionPrefetchingPolicyImpl.java4
4 files changed, 16 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java
index e1431d139d..6db52c3771 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java
@@ -115,6 +115,12 @@ public abstract class AbstractCDOID implements CDOID
}
}
+ @Override
+ public String toString()
+ {
+ return "CDOID[" + toURIFragment() + "]";
+ }
+
protected abstract int doCompareTo(CDOID o) throws ClassCastException;
/**
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOIDDanglingImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOIDDanglingImpl.java
index 2447a7d473..ddd8f03866 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOIDDanglingImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOIDDanglingImpl.java
@@ -157,6 +157,12 @@ public class CDOIDDanglingImpl extends AbstractCDOID implements CDOIDDangling
}
@Override
+ public String toString()
+ {
+ return "CDOIDDangling[" + target + "]";
+ }
+
+ @Override
protected int doCompareTo(CDOID o) throws ClassCastException
{
return toURIFragment().compareTo(((CDOIDDanglingImpl)o).toURIFragment());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
index ea1fca52d9..97bef7dde8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
@@ -459,8 +459,8 @@ public final class CDOStore implements EStore
Collection<CDOID> listOfIDs = policy.loadAhead(revisionManager, eObject, feature, list, index, id);
if (!listOfIDs.isEmpty())
{
- revisionManager.getRevisions(listOfIDs, view.getSession().options().getCollectionLoadingPolicy()
- .getInitialChunkSize());
+ int initialChunkSize = view.getSession().options().getCollectionLoadingPolicy().getInitialChunkSize();
+ revisionManager.getRevisions(listOfIDs, initialChunkSize);
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDORevisionPrefetchingPolicyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDORevisionPrefetchingPolicyImpl.java
index 446e4636d9..0ea0d08ae7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDORevisionPrefetchingPolicyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDORevisionPrefetchingPolicyImpl.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
@@ -52,7 +52,7 @@ public class CDORevisionPrefetchingPolicyImpl implements CDORevisionPrefetchingP
if (element instanceof CDOID)
{
CDOID idElement = (CDOID)element;
- if (!idElement.isTemporary())
+ if (!idElement.isTemporary() && !idElement.isDangling())
{
if (!revisionManager.containsRevision(idElement))
{

Back to the top