Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2017-05-17 11:49:35 -0400
committerEike Stepper2017-05-17 11:49:35 -0400
commitf842034cb3c7174a6e83ab2aacf36dd306513ea3 (patch)
treedf26fe00ba9187ac54fd8d4f0d47309f9b85a737
parentc310ac782023d7ff7fe22661fe260b7f505ee810 (diff)
downloadcdo-f842034cb3c7174a6e83ab2aacf36dd306513ea3.tar.gz
cdo-f842034cb3c7174a6e83ab2aacf36dd306513ea3.tar.xz
cdo-f842034cb3c7174a6e83ab2aacf36dd306513ea3.zip
[Releng] Refactor CDOFeatureDelta.UNKNOWN_VALUE
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDelta.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java13
3 files changed, 22 insertions, 16 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDelta.java
index 69e95f1cdc..036411a74a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDelta.java
@@ -12,9 +12,9 @@
package org.eclipse.emf.cdo.common.revision.delta;
import org.eclipse.emf.cdo.common.revision.CDORevision;
+import org.eclipse.emf.cdo.internal.common.revision.delta.CDOFeatureDeltaImpl;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.NotifierImpl;
import org.eclipse.emf.ecore.EStructuralFeature;
/**
@@ -37,14 +37,7 @@ public interface CDOFeatureDelta
/**
* @since 3.0
*/
- public static final Object UNKNOWN_VALUE = new NotifierImpl()
- {
- @Override
- public String toString()
- {
- return "UNKNOWN"; //$NON-NLS-1$
- }
- };
+ public static final Object UNKNOWN_VALUE = new CDOFeatureDeltaImpl.UnknownValue();
public Type getType();
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java
index 71cc783d5d..6a79ef5acd 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java
@@ -383,26 +383,26 @@ public class CDORevisionManagerImpl extends Lifecycle implements InternalCDORevi
private RevisionInfo.Available createRevisionInfoAvailable(InternalCDORevision revision, CDOBranchPoint requestedBranchPoint)
{
+ CDOID id = revision.getID();
+
if (revision instanceof PointerCDORevision)
{
- PointerCDORevision pointer = (PointerCDORevision)revision;
- CDOBranchVersion target = pointer.getTarget();
- InternalCDORevision targetRevision = target == null ? null : getCachedRevisionByVersion(pointer.getID(), target);
+ CDOBranchVersion target = ((PointerCDORevision)revision).getTarget();
+ InternalCDORevision targetRevision = target == null ? null : getCachedRevisionByVersion(id, target);
if (targetRevision != null)
{
target = targetRevision;
}
- return new RevisionInfo.Available.Pointer(pointer.getID(), requestedBranchPoint, pointer, target);
+ return new RevisionInfo.Available.Pointer(id, requestedBranchPoint, revision, target);
}
if (revision instanceof DetachedCDORevision)
{
- DetachedCDORevision detached = (DetachedCDORevision)revision;
- return new RevisionInfo.Available.Detached(detached.getID(), requestedBranchPoint, detached);
+ return new RevisionInfo.Available.Detached(id, requestedBranchPoint, revision);
}
- return new RevisionInfo.Available.Normal(revision.getID(), requestedBranchPoint, revision);
+ return new RevisionInfo.Available.Normal(id, requestedBranchPoint, revision);
}
private RevisionInfo.Missing createRevisionInfoMissing(CDOID id, CDOBranchPoint requestedBranchPoint)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java
index e4de3054b2..98e088b68b 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.cdo.spi.common.revision.InternalCDOFeatureDelta;
import org.eclipse.net4j.util.CheckUtil;
+import org.eclipse.emf.common.notify.impl.NotifierImpl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -94,4 +95,16 @@ public abstract class CDOFeatureDeltaImpl implements InternalCDOFeatureDelta
public abstract boolean adjustReferences(CDOReferenceAdjuster referenceAdjuster);
protected abstract String toStringAdditional();
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class UnknownValue extends NotifierImpl
+ {
+ @Override
+ public String toString()
+ {
+ return "UNKNOWN"; //$NON-NLS-1$
+ }
+ }
}

Back to the top