summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-01 15:48:34 (EDT)
committerEike Stepper2007-08-01 15:48:34 (EDT)
commit829ad174fdc7dca644629edf9d6f6b8fabc9338a (patch)
treeadbf5b8c162210a1b0e6ac99f4e79e9ab784772a
parentaee76e3052729d2db15634d71c09501ce12c7760 (diff)
downloadcdo-829ad174fdc7dca644629edf9d6f6b8fabc9338a.zip
cdo-829ad174fdc7dca644629edf9d6f6b8fabc9338a.tar.gz
cdo-829ad174fdc7dca644629edf9d6f6b8fabc9338a.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java26
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/fsm/FiniteStateMachine.java8
3 files changed, 23 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
index b901b0b..0a299f3 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
@@ -114,7 +114,7 @@ public class CDOPackageRegistryImpl extends EPackageRegistryImpl implements CDOP
public EPackage getEPackage()
{
EPackage ePackage = ModelUtil.createEPackage(cdoPackage, CDOPackageRegistryImpl.this);
- session.registerEPackage(ePackage);
+ session.registerEPackage(ePackage, cdoPackage.getMetaIDRange());
return ePackage;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
index a595f14..2d9569d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
@@ -281,19 +281,28 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
return metaInstanceToIDMap.get(metaInstance);
}
+ public void registerEPackage(EPackage ePackage, CDOIDRange metaIDRange)
+ {
+ // TODO Check range is not temp
+ registerMetaInstance((InternalEObject)ePackage, metaIDRange.getLowerBound().getValue());
+ // TODO Check count matches range
+ }
+
public CDOIDRange registerEPackage(EPackage ePackage)
{
- long lowerBound = nextTemporaryID;
- registerMetaInstance((InternalEObject)ePackage);
- return CDOIDRangeImpl.create(lowerBound, nextTemporaryID + 2);
+ long count = registerMetaInstance((InternalEObject)ePackage, nextTemporaryID);
+ long newTempID = nextTemporaryID - 2 * count;
+ CDOIDRange range = CDOIDRangeImpl.create(nextTemporaryID, newTempID + 2);
+ nextTemporaryID = newTempID;
+ return range;
}
/**
* TODO synchronize
*/
- private void registerMetaInstance(InternalEObject metaInstance)
+ private long registerMetaInstance(InternalEObject metaInstance, long idValue)
{
- CDOID id = CDOIDImpl.create(nextTemporaryID);
+ CDOID id = CDOIDImpl.create(idValue);
if (TRACER.isEnabled())
{
TRACER.format("Registering meta instance: {0} <-> {1}", id, metaInstance);
@@ -301,13 +310,14 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
idToMetaInstanceMap.put(id, metaInstance);
metaInstanceToIDMap.put(metaInstance, id);
- --nextTemporaryID;
- --nextTemporaryID;
+ long count = 1;
for (EObject content : metaInstance.eContents())
{
- registerMetaInstance((InternalEObject)content);
+ count += registerMetaInstance((InternalEObject)content, idValue + 2 * count);
}
+
+ return count;
}
public void remapMetaInstance(CDOID oldID, CDOID newID)
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/fsm/FiniteStateMachine.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/fsm/FiniteStateMachine.java
index 76119f6..47e6ade 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/fsm/FiniteStateMachine.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/fsm/FiniteStateMachine.java
@@ -106,10 +106,10 @@ public abstract class FiniteStateMachine<STATE extends Enum, EVENT extends Enum,
ITransition transition = transitions[s][e];
if (transition == IGNORE)
{
- if (TRACER.isEnabled())
- {
- TRACER.trace(formatIgnoreMessage(subject, state, event, data));
- }
+ // if (TRACER.isEnabled())
+ // {
+ // TRACER.trace(formatIgnoreMessage(subject, state, event, data));
+ // }
}
else if (transition == FAIL)
{