Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java36
1 files changed, 22 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java
index 8cc6faab63..6a02a748c8 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BranchingFeatureMapTableMappingWithRanges.java
@@ -394,7 +394,13 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList
public void readValues(IDBStoreAccessor accessor, InternalCDORevision revision, int listChunk)
{
- MoveableList<Object> list = revision.getList(getFeature());
+ MoveableList<Object> list = revision.getListOrNull(getFeature());
+ if (list == null)
+ {
+ // Nothing to read take shortcut.
+ return;
+ }
+
int valuesToRead = list.size();
if (listChunk != CDORevision.UNCHUNKED && listChunk < valuesToRead)
@@ -404,7 +410,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList
if (valuesToRead == 0)
{
- // nothing to read take shortcut
+ // Nothing to read take shortcut.
return;
}
@@ -680,17 +686,19 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList
public void writeValues(IDBStoreAccessor accessor, InternalCDORevision revision)
{
- CDOList values = revision.getList(getFeature());
-
- int idx = 0;
- for (Object element : values)
+ CDOList values = revision.getListOrNull(getFeature());
+ if (values != null)
{
- writeValue(accessor, revision, idx++, element);
- }
+ int idx = 0;
+ for (Object element : values)
+ {
+ writeValue(accessor, revision, idx++, element);
+ }
- if (TRACER.isEnabled())
- {
- TRACER.format("Writing done"); //$NON-NLS-1$
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Writing done"); //$NON-NLS-1$
+ }
}
}
@@ -830,7 +838,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList
TRACER.format("objectDetached {1}", revision); //$NON-NLS-1$
}
- clearList(accessor, id, branchId, revision.getVersion(), FINAL_VERSION, revision.getList(getFeature()).size() - 1, revised);
+ clearList(accessor, id, branchId, revision.getVersion(), FINAL_VERSION, revision.size(getFeature()) - 1, revised);
}
@Override
@@ -850,7 +858,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList
}
InternalCDORevision originalRevision = (InternalCDORevision)accessor.getTransaction().getRevision(id);
- int oldListSize = originalRevision.getList(getFeature()).size();
+ int oldListSize = originalRevision.size(getFeature());
if (TRACER.isEnabled())
{
@@ -911,7 +919,7 @@ public class BranchingFeatureMapTableMappingWithRanges extends AbstractBasicList
branchID = targetBranchID;
this.oldVersion = oldVersion;
this.newVersion = newVersion;
- lastIndex = originalRevision.getList(getFeature()).size() - 1;
+ lastIndex = originalRevision.size(getFeature()) - 1;
this.timestamp = timestamp;
}

Back to the top