From 5500e62365c1f81c76da6fcea557ae463da11c85 Mon Sep 17 00:00:00 2001
From: Simon Barner <barner@fortiss.org>
Date: Thu, 12 Mar 2015 08:55:06 +0000
Subject: [PATCH] - Assign unique IDs to annotations as soon as the are
 instantiated (before, annotations relied on the ID-fixup that is triggered
 when the model is persisted) refs 2309

---
 .../base/annotation/valueprovider/ValueProviderBase.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/valueprovider/ValueProviderBase.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/valueprovider/ValueProviderBase.java
index 059eed06e..75371e7cd 100644
--- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/valueprovider/ValueProviderBase.java
+++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/valueprovider/ValueProviderBase.java
@@ -32,6 +32,7 @@ import org.eclipse.emf.ecore.EFactory;
 import org.eclipse.emf.ecore.EObject;
 import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
 import org.fortiss.tooling.base.model.element.IModelElement;
+import org.fortiss.tooling.kernel.service.IPersistencyService;
 
 /**
  * Base class for {@link IAnnotationValueProvider}s.
@@ -39,7 +40,7 @@ import org.fortiss.tooling.base.model.element.IModelElement;
  * @author diewald, barner
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating GREEN Hash: 4A309AB5ED479F1856AD26C2AB61B259
+ * @ConQAT.Rating YELLOW Hash: 68F8F5C4D491184B72784AC7242EEADC
  */
 public abstract class ValueProviderBase<T extends IAnnotatedSpecification> implements
 		IAnnotationValueProvider<T> {
@@ -198,6 +199,9 @@ public abstract class ValueProviderBase<T extends IAnnotatedSpecification> imple
 			}
 		}
 
+		// Assign unique id
+		IPersistencyService.INSTANCE.getTopLevelElementFor(element).prepareIDs(specification);
+
 		// Hook specification to model element
 		element.addSpecification(specification);
 
-- 
GitLab