Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-11-27 03:12:12 -0500
committerEike Stepper2011-11-27 03:12:12 -0500
commit2372a6d550fcdc21c038d345c5190829545e010c (patch)
treec37c8f599980cea078a89d0074cbf2884e389d2e
parente3aadde7d7a43135f96730b0f1538f9ee80c4222 (diff)
downloadcdo-bugs/352204.tar.gz
cdo-bugs/352204.tar.xz
cdo-bugs/352204.zip
[352204] [Legacy] Failing event PREPARE in state CLEAN : state machine issue with legacy mode bugs/352204
https://bugs.eclipse.org/bugs/show_bug.cgi?id=352204
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_352204_Test.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359966_Test.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/FSMUtil.java9
6 files changed, 22 insertions, 21 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java
index 88b06eaf40..6a5f2a2bb5 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java
@@ -220,6 +220,7 @@ public abstract class AllConfigs extends ConfigTestSuite
testClasses.add(Bugzilla_337587_Test.class);
testClasses.add(Bugzilla_338779_Test.class);
testClasses.add(Bugzilla_338884_Test.class);
+ testClasses.add(Bugzilla_338921_Test.class);
testClasses.add(Bugzilla_339313_Test.class);
testClasses.add(Bugzilla_339461_Test.class);
testClasses.add(Bugzilla_339908_Test.class);
@@ -235,18 +236,17 @@ public abstract class AllConfigs extends ConfigTestSuite
testClasses.add(Bugzilla_350027_Test.class);
testClasses.add(Bugzilla_351067_Test.class);
testClasses.add(Bugzilla_351096_Test.class);
- testClasses.add(Bugzilla_338921_Test.class);
testClasses.add(Bugzilla_351393_Test.class);
testClasses.add(Bugzilla_351921_Test.class);
+ testClasses.add(Bugzilla_352204_Test.class);
testClasses.add(Bugzilla_352303_Test.class);
testClasses.add(Bugzilla_352832_Test.class);
testClasses.add(Bugzilla_354395_Test.class);
testClasses.add(Bugzilla_355915_Test.class);
testClasses.add(Bugzilla_357441_Test.class);
- testClasses.add(Bugzilla_359966_Test.class);
testClasses.add(Bugzilla_359669_Test.class);
+ testClasses.add(Bugzilla_359966_Test.class);
testClasses.add(Bugzilla_359992_Test.class);
testClasses.add(Bugzilla_363287_Test.class);
- testClasses.add(Bugzilla_352204_Test.class);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_352204_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_352204_Test.java
index 06ee55aea1..bf3879ff58 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_352204_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_352204_Test.java
@@ -36,12 +36,12 @@ public class Bugzilla_352204_Test extends AbstractCDOTest
{
private static final String MODEL_LOCATION_PATH = "myResource";
- public void testChangesImportWithNewLegacyElementsWithCustomFileAndReconstructSavePoints() throws Exception
+ public void testWithReconstructSavepoints() throws Exception
{
importWithNewLegacyElements(true);
}
- public void _testChangesImportWithNewLegacyElementsWithCustomFileAndNotReconstructSavePoints() throws Exception
+ public void testWithoutReconstructSavepoints() throws Exception
{
importWithNewLegacyElements(false);
}
@@ -80,11 +80,6 @@ public class Bugzilla_352204_Test extends AbstractCDOTest
{
CDOSession session = openSession();
CDOTransaction delegate = session.openTransaction();
- if (fileForStoringChanges == null)
- {
- return new CDOPushTransaction(delegate);
- }
-
return new CDOPushTransaction(delegate, fileForStoringChanges, reconstructSavePoints);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359966_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359966_Test.java
index 153f69022d..af716e1d53 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359966_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_359966_Test.java
@@ -63,12 +63,12 @@ public class Bugzilla_359966_Test extends AbstractCDOTest
checkDiagramAsCorrectlyBeenModified(transaction);
}
- public void testChangesImportWithNewLegacyElementsWithCustomFileAndReconstructSavePoints() throws Exception
+ public void testWithReconstructSavepoints() throws Exception
{
importWithNewLegacyElements(true);
}
- public void testChangesImportWithNewLegacyElementsWithCustomFileAndNotReconstructSavePoints() throws Exception
+ public void testWithoutReconstructSavepoints() throws Exception
{
importWithNewLegacyElements(false);
}
@@ -120,11 +120,6 @@ public class Bugzilla_359966_Test extends AbstractCDOTest
{
CDOSession session = openSession();
CDOTransaction delegate = session.openTransaction();
- if (fileForStoringChanges == null)
- {
- return new CDOPushTransaction(delegate);
- }
-
return new CDOPushTransaction(delegate, fileForStoringChanges, reconstructSavePoints);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
index 3d8e63c43c..2abcad2eed 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
@@ -1290,14 +1290,16 @@ public class CDOResourceImpl extends CDOResourceLeafImpl implements CDOResource,
{
if (!FSMUtil.isTransient(this))
{
- InternalCDOObject cdoObject = FSMUtil.adapt(object, cdoView());
+ InternalCDOTransaction transaction = cdoView().toTransaction();
+ InternalCDOObject cdoObject = FSMUtil.adapt(object, transaction);
- if (CDOUtil.isLegacyObject(cdoObject) && cdoObject.cdoState() == CDOState.CLEAN)
+ if (CDOUtil.isLegacyObject(cdoObject) && FSMUtil.isClean(cdoObject))
{
+ // Bug 352204
return;
}
- attached(cdoObject, cdoView().toTransaction());
+ attached(cdoObject, transaction);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java
index 5d6cdd2489..ec345ed94f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java
@@ -423,9 +423,9 @@ public abstract class CDOLegacyWrapper extends CDOObjectWrapper
protected void revisionToInstanceContainer()
{
Object containerID = revision.getContainerID();
- EObject oldContainer = instance.eContainer();
InternalEObject container = getEObjectFromPotentialID(view, null, containerID);
+ EObject oldContainer = instance.eContainer();
if (oldContainer != container)
{
setInstanceContainer(container, revision.getContainingFeatureID());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/FSMUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/FSMUtil.java
index 5a3922bc5e..f951eef047 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/FSMUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/FSMUtil.java
@@ -63,6 +63,15 @@ public final class FSMUtil
return state == CDOState.NEW;
}
+ /**
+ * @since 4.1
+ */
+ public static boolean isClean(CDOObject object)
+ {
+ CDOState state = object.cdoState();
+ return state == CDOState.CLEAN;
+ }
+
public static boolean isNative(EObject eObject)
{
return eObject instanceof CDOObjectImpl;

Back to the top