Skip to content
Snippets Groups Projects
Commit 3197fd85 authored by Simon Barner's avatar Simon Barner
Browse files

- Document get(0)

parent eb80e8c9
No related branches found
No related tags found
No related merge requests found
......@@ -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")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment