Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2018-01-30 11:10:05 +0000
committerEike Stepper2018-01-30 15:05:03 +0000
commit4e1a55a49b6cdf31dcf7213c8add89f189ba3773 (patch)
tree38299acd5e3bf7dc2086212c5f5cd1e524d21d20 /plugins/org.eclipse.emf.cdo/src/org/eclipse
parente916a1a9febe2fccd366eb7f9a24cdfbb9f394cc (diff)
downloadcdo-4e1a55a49b6cdf31dcf7213c8add89f189ba3773.tar.gz
cdo-4e1a55a49b6cdf31dcf7213c8add89f189ba3773.tar.xz
cdo-4e1a55a49b6cdf31dcf7213c8add89f189ba3773.zip
[530498] Handle reattached elements in RewriteTransition
When the CDOUndoDetector detects an undo dirty elements are removed from dirty object, their state is set from DIRTY to CLEAN but they also need to be removed from reattached/detached objects, otherwise this could later lead to IllegalStateException if CDOTransaction.rollback is called (their is no more revision in CDOTransactionImpl.cleanRevisions for an element known in detachedObjects). https://bugs.eclipse.org/bugs/show_bug.cgi?id=530498 Change-Id: Ib77ac7e72bec165ecac9faf05590385e1d77ec06 Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr> Signed-off-by: Eike Stepper <stepper@esc-net.de>
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java
index 5b3ec98b0b..423e58810c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2016 Eike Stepper (Berlin, Germany) and others.
+ * Copyright (c) 2011-2018 Eike Stepper (Berlin, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
* Simon McDuff - maintenance
+ * Maxime Porhel - maintenance
*/
package org.eclipse.emf.internal.cdo.view;
@@ -1259,6 +1260,11 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
revisionDeltas.remove(id);
lastSavepoint.getDirtyObjects().remove(id);
+ if (lastSavepoint.getReattachedObjects().remove(id) != null)
+ {
+ lastSavepoint.getDetachedObjects().remove(id);
+ }
+
object.cdoInternalSetRevision(cleanRevision);
changeState(object, CDOState.CLEAN);
}

Back to the top