Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Dugueperoux2014-09-03 12:32:52 +0000
committerEsteban Dugueperoux2014-09-03 12:33:10 +0000
commit1ca63f05f0ce6ae5673ce7b53c7e20b61019ebb7 (patch)
treea21c449e78970e718d09eb6cf9b19270613ffab8
parentecd17c2fb40964753e94c14f35c5a873cdd043ed (diff)
downloadcdo-1ca63f05f0ce6ae5673ce7b53c7e20b61019ebb7.tar.gz
cdo-1ca63f05f0ce6ae5673ce7b53c7e20b61019ebb7.tar.xz
cdo-1ca63f05f0ce6ae5673ce7b53c7e20b61019ebb7.zip
[435532] Reordering elements in a containment feature causes DBException
when audit mode is activated https://bugs.eclipse.org/bugs/show_bug.cgi?id=435532 - enhance a little ListDeltaVisitor.applyOffsetToSource/DestinationIndexes() Change-Id: I93a560200e48035bc96f00bd5dd47cb8cb6b42cb Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=435532
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java
index ae911bda37..1badb55f3d 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/NonAuditListTableMapping.java
@@ -711,23 +711,29 @@ public class NonAuditListTableMapping extends AbstractListTableMapping implement
private void applyOffsetToSourceIndexes(int offsetBefore)
{
- for (ManipulationElement element : manipulations)
+ if (offsetBefore != 0)
{
- if (element.sourceIndex != ManipulationConstants.NO_INDEX)
+ for (ManipulationElement element : manipulations)
{
- element.sourceIndex += offsetBefore;
+ if (element.sourceIndex != ManipulationConstants.NO_INDEX)
+ {
+ element.sourceIndex += offsetBefore;
+ }
}
}
}
private void applyOffsetToDestinationIndexes(int offsetAfter)
{
- for (ManipulationElement element : manipulations)
+ if (offsetAfter != 0)
{
- if (element.destinationIndex != ManipulationConstants.NO_INDEX)
+ for (ManipulationElement element : manipulations)
{
- // apply the offset to all indices to make them relative to the new offset
- element.destinationIndex += offsetAfter;
+ if (element.destinationIndex != ManipulationConstants.NO_INDEX)
+ {
+ // apply the offset to all indices to make them relative to the new offset
+ element.destinationIndex += offsetAfter;
+ }
}
}
}

Back to the top