Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2007-02-05 13:20:48 +0000
committermtaal2007-02-05 13:20:48 +0000
commit859cdbdecd8da7b5322f76ce9e4401c8cb9794cc (patch)
tree36e680d55d4df7236595dc91936bd7445ba55f43
parent445e77911ebccc73477265a7a7fdf07efa6c16f7 (diff)
downloadorg.eclipse.emf.teneo-859cdbdecd8da7b5322f76ce9e4401c8cb9794cc.tar.gz
org.eclipse.emf.teneo-859cdbdecd8da7b5322f76ce9e4401c8cb9794cc.tar.xz
org.eclipse.emf.teneo-859cdbdecd8da7b5322f76ce9e4401c8cb9794cc.zip
Resolved small issue which can occur with multiple inheritance and same id feature name in multiple trees.
-rw-r--r--plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java b/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java
index 72f714357..76788f1a2 100644
--- a/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java
+++ b/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: DefaultAnnotator.java,v 1.22 2007/02/05 13:04:53 mtaal Exp $
+ * $Id: DefaultAnnotator.java,v 1.23 2007/02/05 13:20:48 mtaal Exp $
*/
package org.eclipse.emf.teneo.annotations.mapper;
@@ -80,7 +80,7 @@ import org.eclipse.emf.teneo.util.StoreUtil;
* information. It sets the default annotations according to the ejb3 spec.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.22 $
+ * @version $Revision: 1.23 $
*/
public class DefaultAnnotator {
@@ -346,7 +346,9 @@ public class DefaultAnnotator {
if (!firstDone) {
superClass = eSuperClass;
}
- idFeatures.addAll(getIDFeaturesNames(aSuperClass));
+ final List superList = getIDFeaturesNames(aSuperClass);
+ idFeatures.removeAll(superList);
+ idFeatures.addAll(superList);
if (!idFeatures.isEmpty())
break;
}
@@ -1324,9 +1326,10 @@ public class DefaultAnnotator {
EStructuralFeature feature = (EStructuralFeature) it.next();
PAnnotatedEStructuralFeature aStructuralFeature = aClass.getPaModel().getPAnnotated(feature);
if (aStructuralFeature instanceof PAnnotatedEAttribute) {
- PAnnotatedEAttribute aAttribute = (PAnnotatedEAttribute) aStructuralFeature;
- if (aAttribute.getId() != null) {
- list.add(aAttribute.getAnnotatedEAttribute().getName());
+ final PAnnotatedEAttribute aAttribute = (PAnnotatedEAttribute) aStructuralFeature;
+ final String attrName = aAttribute.getAnnotatedEAttribute().getName();
+ if (aAttribute.getId() != null && !list.contains(attrName)) {
+ list.add(attrName);
}
}
}
@@ -1336,7 +1339,9 @@ public class DefaultAnnotator {
final EClass eClass = (EClass) it.next();
final PAnnotatedEClass aSuperClass = annotatedModel.getPAnnotated(eClass);
if (aSuperClass != null) {
- list.addAll(getIDFeaturesNamesRecurse(aSuperClass));
+ final List superList = getIDFeaturesNamesRecurse(aSuperClass);
+ list.removeAll(superList);
+ list.addAll(superList);
}
if (!list.isEmpty()) {
return list;

Back to the top