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

createStructuralFeatureInstance(): Do not try to create any instances for EReferences:

  - Contained features are created automatically by the generated EFactory
  - Non-contained features must be set by the user
-> Return null in any case
refs 1841
parent c149372d
No related branches found
No related tags found
No related merge requests found
......@@ -344,13 +344,7 @@ public abstract class EStructuralFeatureValueProviderBase<T extends IAnnotatedSp
// Return data types default value
return attributeEDataType.getDefaultValue();
} else if(structuralFeature instanceof EReference) {
EReference reference = (EReference)structuralFeature;
if(reference.isContainment()) {
// EClasses attached to contained EReferences are created lazily by the
// corresponding generated code on the first access (i.e., also during get / "read")
return null;
}
return factory.create(reference.getEReferenceType());
return null;
} else {
throw new Exception(
"createStructuralFeatureInstance() is not supported / has not been implemented for the annotation type " +
......
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