diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/CreateAnnotationInstanceColumn.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/CreateAnnotationInstanceColumn.java index 54785af81a706340162fff96015137dc28dabfa3..91d33527d9ef394ea7f2defff532a2959a2f3a52 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/CreateAnnotationInstanceColumn.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/CreateAnnotationInstanceColumn.java @@ -64,7 +64,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService; * @author diewald, barner * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: C2AA23B5E35EDC19786775640DD3F6CE + * @ConQAT.Rating GREEN Hash: A24FA05DE5A868FBA7F8EE21F78CDDD0 */ public class CreateAnnotationInstanceColumn extends ViewerColumn { @@ -237,11 +237,15 @@ public class CreateAnnotationInstanceColumn extends ViewerColumn { // editable String value = ""; if(!columnSpec.eClass().getEStructuralFeatures().isEmpty()) { + // get(0) is safe because list is guaranteed to be non-empty. + // Furthermore, the first element is the one to use, since... EStructuralFeature dynamicInstanceFeature = columnSpec.eClass().getEStructuralFeatures().get(0); - // Annotations that can be dynamically instantiated are - // implemented using an appropriate EMap. + // ...annotations that can be dynamically instantiated are + // implemented using an appropriate EMap (which by convention + // has to be the // first (and only)) feature of the + // corresponding annotation class. if(dynamicInstanceFeature.getEType().getInstanceTypeName() .equals("java.util.Map$Entry")) {