Commit d2501ceb authored by Marco Konersmann's avatar Marco Konersmann

Fixes some errors in the error handling. running example up to im2code works

parent ff34db16
Pipeline #3024 failed with stages
in 1 minute and 20 seconds
......@@ -49,7 +49,7 @@ public class ModelIntegrationTask extends AbstractTask {
adl2il.join();
final InterProfileTransformationToImplementationModelTask profileTransformation = new InterProfileTransformationToImplementationModelTask(
implementationLanguage, specificationLanguage, adl2il.getIdRegistry(),
specificationLanguage, implementationLanguage, adl2il.getIdRegistry(),
adl2il.getResultModelRoots(), true);
profileTransformation.setProgressGroup(monitor, 1);
profileTransformation.schedule();
......
......@@ -44,7 +44,7 @@ public class InterProfileTransformationToImplementationModelTask extends Abstrac
SubMonitor monitor = SubMonitor.convert(progressMonitor, "Executing Inter-Profile Transformations", 5);
final IInterprofileTransformation t = IInterprofileTransformation.createInstance();
final TransformationResult result = t.transform(targetLanguage, sourceLanguage, priorModelRoots,
final TransformationResult result = t.transform(sourceLanguage, targetLanguage, priorModelRoots,
priorIdRegistry, TASK_NAME, monitor.newChild(4));
resultModelRoots = result.getModelRoots();
......
......@@ -3,7 +3,7 @@ package org.codeling.ui.handlers;
import java.util.List;
import org.codeling.languageregistry.ImplementationLanguageDefinition;
import org.codeling.transformationmanager.internal.steps.InterProfileTransformationToSpecificationModelTask;
import org.codeling.transformationmanager.internal.steps.InterProfileTransformationToImplementationModelTask;
import org.codeling.transformationmanager.internal.steps.TranslationModelToImplementationModelTask;
import org.codeling.utils.IDRegistry;
import org.codeling.utils.Models;
......@@ -24,8 +24,8 @@ public class IL2AIL_ImplementationMigrationHandler extends AbstractSteppedHandle
if (implementationLanguage == null)
return Status.CANCEL_STATUS;
final IDRegistry priorIdRegistry = IDRegistry.load(InterProfileTransformationToSpecificationModelTask.ID_FILEPATH);
final List<EObject> priorModelRoots = Models.loadFrom(InterProfileTransformationToSpecificationModelTask.MODEL_FILEPATH);
final IDRegistry priorIdRegistry = IDRegistry.load(InterProfileTransformationToImplementationModelTask.ID_FILEPATH);
final List<EObject> priorModelRoots = Models.loadFrom(InterProfileTransformationToImplementationModelTask.MODEL_FILEPATH);
final Job job = new TranslationModelToImplementationModelTask(implementationLanguage, priorIdRegistry, priorModelRoots, true, true);
......
......@@ -4,7 +4,7 @@ import java.util.List;
import org.codeling.languageregistry.LanguageDefinition;
import org.codeling.transformationmanager.internal.steps.InterProfileTransformationToImplementationModelTask;
import org.codeling.transformationmanager.internal.steps.ProgramCodeToTranslationModelTask;
import org.codeling.transformationmanager.internal.steps.SpecificationModelToTranslationModelTask;
import org.codeling.utils.CodelingException;
import org.codeling.utils.IDRegistry;
import org.codeling.utils.Models;
......@@ -27,8 +27,8 @@ public class ILProfileTransformationToCodeHandler extends AbstractSteppedHandler
throw new ExecutionException("Could not get languages from the user.", e);
}
final IDRegistry priorIdRegistry = IDRegistry.load(ProgramCodeToTranslationModelTask.ID_FILEPATH);
final List<EObject> priorModelRoots = Models.loadFrom(ProgramCodeToTranslationModelTask.MODEL_FILEPATH);
final IDRegistry priorIdRegistry = IDRegistry.load(SpecificationModelToTranslationModelTask.ID_FILEPATH);
final List<EObject> priorModelRoots = Models.loadFrom(SpecificationModelToTranslationModelTask.MODEL_FILEPATH);
final Job job = new InterProfileTransformationToImplementationModelTask(languageDefinitions[1], languageDefinitions[0],
priorIdRegistry, priorModelRoots, true);
......
......@@ -227,7 +227,8 @@ public abstract class AbstractModelCodeTransformation<ELEMENTECLASS extends EObj
}
// Registers all class, reference, and attribute transformations for an Eclass.
findTranslatedElements.addTransformation(modelElement.eClass(), this);
if (modelElement != null)
findTranslatedElements.addTransformation(modelElement.eClass(), this);
}
} else {
try {
......
......@@ -19,6 +19,8 @@ import org.eclipse.jdt.core.IField
import org.eclipse.jdt.core.IType
import org.eclipse.jdt.core.dom.AST
import org.codeling.mechanisms.transformations.ClassMechanismTransformation
import org.modelversioning.emfprofileapplication.StereotypeApplication
import org.modelversioning.emfprofileapplication.StereotypeApplicability
abstract class AnnotatedMemberReferenceTransformation<OWNERECLASS extends EObject, TARGETECLASS extends EObject> extends ReferenceMechanismTransformation<OWNERECLASS, TARGETECLASS, IType> {
......@@ -89,6 +91,8 @@ abstract class AnnotatedMemberReferenceTransformation<OWNERECLASS extends EObjec
// We want to keep any custom annotations on the "states" field in the 'x..* MarkerInterface' scenario. Therefore we change the annotation parameters.
val LinkedList<EObject> targets = new LinkedList();
targets.addAll(modelElement.eGet(eReference) as Collection<EObject>);
if (targets === null)
return;
if (targetIsMarkerInterface) {
updateMarkerInterfaceReferenceMulti(targets);
} else {
......@@ -96,6 +100,8 @@ abstract class AnnotatedMemberReferenceTransformation<OWNERECLASS extends EObjec
}
} else {
val EObject target = modelElement.eGet(eReference) as EObject;
if (target === null)
return;
if (targetIsMarkerInterface) {
updateMarkerInterfaceReferenceSingle(target);
} else {
......
......@@ -62,22 +62,14 @@ abstract class ContainmentOperationReferenceAnnotationParameterTransformation<OW
else
newLinkedList(((modelElement).eGet(eReference)) as EObject);
val List<EObject> oldTargets = if (eReference.isMany)
newLinkedList((priorModelElement).eGet(eReference) as Collection<EObject>)
else
newLinkedList(((priorModelElement as EObject).eGet(eReference)) as EObject);
val List<IJavaElement> targetsToAdd = newLinkedList();
newTargets.forEach [ newTarget |
if (!idRegistry.knowsImplementationModelElement(newTarget)) {
return;
}
val newTargetID = idRegistry.getIDFromImplementationModelElement(newTarget);
if (!oldTargets.
exists[oldTarget|priorIDRegistry.getIDFromImplementationModelElement(oldTarget) == newTargetID]) {
val IJavaElement newCodeElement = idRegistry.getCodeElement(newTargetID);
val targetTransformations = findTranslatedElements.getTransformationsFor(newTarget);
if (targetTransformations.empty)
addError("No transformation found for " + newTarget);
val IJavaElement newCodeElement = targetTransformations.head.codeElement;
if (targetTransformations.head.priorModelElement === null)
targetsToAdd.add(newCodeElement);
}
];
if (!eReference.isMany && !targetsToAdd.empty) {
......@@ -85,11 +77,11 @@ abstract class ContainmentOperationReferenceAnnotationParameterTransformation<OW
targetsToAdd.get(0).elementName);
}
// TODO: Handle references with isMany=true
// Should handle deletions and references with isMany=true here
}
override deleteCodeFragments() {
// TODO: remove annotation member value (only if 0..*)
// remove annotation member value (only if 0..*)
}
override transformToModel() throws CodelingException {
......
package org.codeling.lang.ejbWithStatemachine.transformation.component_feature;
import java.text.MessageFormat;
import java.util.LinkedList;
import java.util.List;
import org.codeling.utils.CodelingException;
import org.codeling.mechanisms.transformations.ClassMechanismTransformation;
import org.codeling.mechanisms.transformations.references.AnnotatedMemberReferenceTransformation;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IImportDeclaration;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.modelversioning.emfprofile.Stereotype;
import org.modelversioning.emfprofileapplication.StereotypeApplication;
import de.mkonersmann.advert.java.embed.ASTUtils;
import de.mkonersmann.advert.java.embed.JDTUtils;
import de.mkonersmann.advert.java.embed.ModelUtils;
import de.mkonersmann.advert.java.embed.ProfilesUtils;
import de.mkonersmann.advert.java.embed.transformation.AbstractModelCodeTransformation;
import de.mkonersmann.advert.java.embed.transformation.references.IALHolder;
import de.mkonersmann.advert.java.embed.transformation.references.IALTransformation;
import de.mkonersmann.il.core.ComponentType;
import de.mkonersmann.il.profiles.Profiles;
public class ChildTransformation extends AbstractModelCodeTransformation<StereotypeApplication, IType>
public class ChildTransformation extends AnnotatedMemberReferenceTransformation<StereotypeApplication, ComponentType>
implements IALTransformation<StereotypeApplication, IType> {
private IALHolder holder = new IALHolder();
private List<IField> fields = new LinkedList<>();
private EStructuralFeature eReference;
public ChildTransformation(
AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation) {
super(parentTransformation);
Stereotype scopedComponent = ProfilesUtils.getStereotype("HierarchicalComponentTypeScoped",
Profiles.COMPONENTS_HIERARCHY_SCOPED.load());
eReference = scopedComponent.getEStructuralFeature("childTypes");
public ChildTransformation(ClassMechanismTransformation<StereotypeApplication, IType> parentTransformation,
EReference eReference) {
super(parentTransformation, eReference);
}
@Override
public void createCodeFragments() throws CodelingException {
// StereotypeApplication hierarchicalComponentType =
// findStereotypeApplication();
@SuppressWarnings("unchecked")
List<EObject> childTypes = (List<EObject>) modelElement.eGet(eReference);
for (EObject childType : childTypes) {
try {
IField field = findFieldThatReferences(childType);
if (field == null) {
addWarning(MessageFormat.format(
"Found no field in type [{0}] which references a [childTypes] {1}. Ignoring the childType.",
codeElement.getElementName(), ModelUtils.getNameAttributeValue(childType)));
continue;
}
ASTUtils.addAnnotation(field, "Child", null);
JDTUtils.addImportIfNecessary(codeElement,
"org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.Child", null);
} catch (JavaModelException e) {
addError(MessageFormat.format("Could not create code fragments for child type [{0}]", childType));
}
}
public String createTypeAnnotationReferenceSingle(EObject target) {
return addChildAnnotation(super.createTypeAnnotationReferenceSingle(target));
}
@Override
public IType resolveCodeElement() throws CodelingException {
IField[] allFields;
try {
allFields = codeElement.getFields();
} catch (JavaModelException e) {
addError(
MessageFormat.format("Could not get the fields of the IType [{0}].", codeElement.getElementName()));
return codeElement;
}
for (IField f : allFields) {
IAnnotation annotation = f.getAnnotation("Child");
IImportDeclaration importDeclStar = f.getCompilationUnit()
.getImport("org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.*");
IImportDeclaration importDeclDirect = f.getCompilationUnit()
.getImport("org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.Child");
if (annotation.exists() && (importDeclStar.exists() || importDeclDirect.exists())) {
fields.add(f);
return codeElement;
}
annotation = f.getAnnotation("org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.Child");
if (annotation.exists())
fields.add(f);
}
return codeElement;
public String createMarkerInterfaceReferenceSingle(EObject target) {
return addChildAnnotation(super.createMarkerInterfaceReferenceSingle(target));
}
@Override
public void updateCodeFragments() throws CodelingException {
// Not implemented.
public String createMarkerInterfaceReferenceMulti(LinkedList<EObject> targets) {
return addChildAnnotation(super.createMarkerInterfaceReferenceMulti(targets));
}
@Override
public void deleteCodeFragments() throws CodelingException {
// Not implemented. The reference always exists, even when it is empty.
private String addChildAnnotation(String originalField) {
try {
JDTUtils.addImportIfNecessary(codeElement, "org.codeling.lang.jee.ial.mm.componentType.Child", null);
} catch (JavaModelException e) {
e.printStackTrace();
}
StringBuffer bf = new StringBuffer();
bf.append("@Child");
bf.append(System.getProperty("line.separator"));
bf.append(originalField);
return bf.toString();
}
@Override
public StereotypeApplication transformToModel() throws CodelingException {
// Not implemented
return null;
public boolean hasExpectedAnnotation(IField field) {
boolean childAnnotationExists = (field.getAnnotation("Child").exists() && (field.getCompilationUnit()
.getImport("org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.Child").exists()
|| field.getCompilationUnit()
.getImport("org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.*").exists()))
|| field.getAnnotation("org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.Child")
.exists();
boolean injectAnnotationExists = (field.getAnnotation("EJB").exists()
&& (field.getCompilationUnit().getImport("javax.ejb.EJB").exists()
|| field.getCompilationUnit().getImport("javax.ejb.*").exists()))
|| field.getAnnotation("javax.ejb.EJB").exists();
return childAnnotationExists && injectAnnotationExists;
}
@Override
public boolean codeFragmentExists() {
try {
resolveCodeElement();
} catch (CodelingException e) {
addError(MessageFormat.format("Could not resolve the code element for the IAL model element [{0}]",
holder.getFoundationalIALElement()));
}
return !fields.isEmpty();
protected String getNewAnnotationName() {
return "javax.ejb.EJB";
}
@Override
public boolean canHandle(EModelElement metaModelElement) {
return metaModelElement == eReference;
public IALHolder getIALHolder() {
return holder;
}
@Override
......@@ -142,45 +99,31 @@ public class ChildTransformation extends AbstractModelCodeTransformation<Stereot
return null;
}
private IField findFieldThatReferences(EObject childType) throws JavaModelException {
String childName = ModelUtils.getNameAttributeValue(childType);
for (IField f : codeElement.getFields())
if (ASTUtils.getFieldType(f).getElementName().equals(childName))
return f;
return null;
}
protected boolean hasExpectedAnnotation(IField field) {
return (field.getAnnotation("Child").exists() && (field.getCompilationUnit()
.getImport("org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.Child").exists()
|| field.getCompilationUnit()
.getImport("org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.*").exists()))
|| field.getAnnotation("org.codeling.lang.ejbWithStatemachine.ial.mm.componenttype_feature.Child")
.exists();
@Override
public boolean codeFragmentExists() {
resolveCodeElement();
return !fields.isEmpty();
}
@Override
protected void doCreateChildTransformationsToCode(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
// None
}
@Override
protected void doCreateChildTransformationsToModel(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
// None
protected ClassMechanismTransformation<? extends EObject, ? extends IJavaElement> createSpecificTransformation(
EObject targetModelElement) {
return null; // not used
}
@Override
public void doCreateCrossReferencesTransformations(
protected void doCreateChildTransformationsToModel(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
// None
}
@Override
public IALHolder getIALHolder() {
return holder;
public void doCreateCrossReferencesTransformations(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
}
}
......@@ -5,14 +5,12 @@
<annotations xmi:id="_Ikq3MFpoEeelvIAT-jDSvQ" key="http://www.eclipse.org/emf/2011/Henshin/Trace" value="CORRESPONDENCE"/>
<annotations xmi:id="_Jh5UcFpoEeelvIAT-jDSvQ" key="http://mkonersmann.de/il/core/1.0" value="TARGET"/>
<annotations xmi:id="_LWnaYFpoEeelvIAT-jDSvQ" key="http://mkonersmann.de/il/profiles/behavior/statemachine/1.0" value="TARGET"/>
<annotations xmi:id="_NLq3gFpoEeelvIAT-jDSvQ" key="http://mkonersmann.de/il/profiles/componenthierarchy/scoped/1.0" value="TARGET"/>
<annotations xmi:id="_x5zzYFpoEeelvIAT-jDSvQ" key="http://mkonersmann.de/il/profiles/interfaces/type/operations/1.0" value="TARGET"/>
<annotations xmi:id="_0CWNMFpoEeelvIAT-jDSvQ" key="http://mkonersmann.de/il/profiles/connectors/1.0" value="TARGET"/>
<annotations xmi:id="_1XD9YFpoEeelvIAT-jDSvQ" key="http://mkonersmann.de/il/profiles/connectors/pc/sync/1to1/1.0" value="TARGET"/>
<annotations xmi:id="_6OHWcFppEeelvIAT-jDSvQ" key="http://mkonersmann.de/il/profiles/interfaces/type/operations/1.0" value="TARGET"/>
<annotations xmi:id="_YMufQFpqEeelvIAT-jDSvQ" key="http://mkonersmann.de/il/profiles/componenthierarchy/flat/1.0" value="TARGET"/>
<annotations xmi:id="_eQNrsFpqEeelvIAT-jDSvQ" key="http://mkonersmann.de/il/profiles/connectors/pc/sync/1to1/1.0" value="TARGET"/>
<annotations xmi:id="_hefL0GStEeeYYITf_14INw" key="http://mkonersmann.de/il/profiles/componenthierarchy/scoped/1.0" value="TARGET"/>
</annotations>
<imports href="http://www.example.org/ejbWithSM#/"/>
<imports href="http://www.eclipse.org/emf/2011/Henshin/Trace#/"/>
......@@ -24,7 +22,6 @@
<imports href="http://mkonersmann.de/il/profiles/interfaces/type/operations/1.0#_TQI18P9gEeKmaPBKfE-rGA"/>
<imports href="http://mkonersmann.de/il/profiles/componenthierarchy/flat/1.0#_XuNXgPROEeKa3u36vOUG8Q"/>
<imports href="http://mkonersmann.de/il/profiles/connectors/pc/sync/1to1/1.0#_vgKHgPUDEeKYKs7GammReg"/>
<imports href="http://mkonersmann.de/il/profiles/componenthierarchy/scoped/1.0#_zvJpEPOmEeKZDuT3NJyhNA"/>
<units xsi:type="henshin:IndependentUnit" xmi:id="_gDmNwFddEeelvIAT-jDSvQ" name="RuleFolder" description="ruleFolder.png" activated="true" subUnits="_twv1kFsTEeelvIAT-jDSvQ _twxDs1sTEeelvIAT-jDSvQ _twxq3FsTEeelvIAT-jDSvQ _twxq7FsTEeelvIAT-jDSvQ _twxq_FsTEeelvIAT-jDSvQ _twxrHFsTEeelvIAT-jDSvQ _twxrLFsTEeelvIAT-jDSvQ _twxrPFsTEeelvIAT-jDSvQ _twxrVFsTEeelvIAT-jDSvQ"/>
<units xsi:type="henshin:IndependentUnit" xmi:id="_gDmNwVddEeelvIAT-jDSvQ" name="ITRuleFolder" description="ITRules.png" activated="true" subUnits="_0T1JgFz_EeeXi75CfCHDUA _0T-6gFz_EeeXi75CfCHDUA _0UHdYFz_EeeXi75CfCHDUA _0UaYUFz_EeeXi75CfCHDUA _0UiUIFz_EeeXi75CfCHDUA _0UpB0Fz_EeeXi75CfCHDUA _0UwWkFz_EeeXi75CfCHDUA _0U3EQFz_EeeXi75CfCHDUA _U21hsF0AEeez3Z4qAkptLg"/>
<units xsi:type="henshin:IndependentUnit" xmi:id="_gDmNwlddEeelvIAT-jDSvQ" name="FTRuleFolder" description="FTRules.png" activated="true" subUnits="_0nkk4Fz_EeeXi75CfCHDUA _0nrSkFz_EeeXi75CfCHDUA _0nyAQFz_EeeXi75CfCHDUA _0oCe8Fz_EeeXi75CfCHDUA _0oLB0Fz_EeeXi75CfCHDUA _0oRvgFz_EeeXi75CfCHDUA _0oYdMFz_EeeXi75CfCHDUA _0ofK4Fz_EeeXi75CfCHDUA _VN7zEF0AEeez3Z4qAkptLg"/>
......
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:tgg="http://tgg.tu-berlin.de">
<tgg:TGG xmi:id="_gC7fYFddEeelvIAT-jDSvQ">
<importedPkgs xmi:id="_hrmu8GGFEeehr-hgunfPog">
<importedPkgs xmi:id="_2-gwwOQ7EeezCMblRgAkug">
<package href="http://www.example.org/ejbWithSM#/"/>
</importedPkgs>
<importedPkgs xmi:id="_hrmu8WGFEeehr-hgunfPog" component="CORRESPONDENCE">
<importedPkgs xmi:id="_2-hX0OQ7EeezCMblRgAkug" component="CORRESPONDENCE">
<package href="http://www.eclipse.org/emf/2011/Henshin/Trace#/"/>
</importedPkgs>
<importedPkgs xmi:id="_hrmu8mGFEeehr-hgunfPog" component="TARGET">
<importedPkgs xmi:id="_2-hX0eQ7EeezCMblRgAkug" component="TARGET">
<package href="http://mkonersmann.de/il/core/1.0#/"/>
</importedPkgs>
<importedPkgs xmi:id="_hrmu82GFEeehr-hgunfPog" component="TARGET">
<importedPkgs xmi:id="_2-hX0uQ7EeezCMblRgAkug" component="TARGET">
<package href="http://mkonersmann.de/il/profiles/behavior/statemachine/1.0#_iGuesLNlEeOxZYCshz0uTg"/>
</importedPkgs>
<importedPkgs xmi:id="_hrmu9GGFEeehr-hgunfPog" component="TARGET">
<importedPkgs xmi:id="_2-hX0-Q7EeezCMblRgAkug" component="TARGET">
<package href="http://mkonersmann.de/il/profiles/interfaces/type/operations/1.0#_TQI18P9gEeKmaPBKfE-rGA"/>
</importedPkgs>
<importedPkgs xmi:id="_hrmu9WGFEeehr-hgunfPog" component="TARGET">
<importedPkgs xmi:id="_2-hX1OQ7EeezCMblRgAkug" component="TARGET">
<package href="http://mkonersmann.de/il/profiles/componenthierarchy/flat/1.0#_XuNXgPROEeKa3u36vOUG8Q"/>
</importedPkgs>
<importedPkgs xmi:id="_hrmu9mGFEeehr-hgunfPog" component="TARGET">
<importedPkgs xmi:id="_2-hX1eQ7EeezCMblRgAkug" component="TARGET">
<package href="http://mkonersmann.de/il/profiles/connectors/pc/sync/1to1/1.0#_vgKHgPUDEeKYKs7GammReg"/>
</importedPkgs>
<importedPkgs xmi:id="_hegZ8GStEeeYYITf_14INw" component="TARGET">
<package href="http://mkonersmann.de/il/profiles/componenthierarchy/scoped/1.0#_zvJpEPOmEeKZDuT3NJyhNA"/>
</importedPkgs>
</tgg:TGG>
<tgg:TGGRule xmi:id="_twv1kFsTEeelvIAT-jDSvQ"/>
<tgg:TripleGraph xmi:id="_twwcolsTEeelvIAT-jDSvQ"/>
......@@ -194,7 +191,7 @@
<tgg:TAttribute xmi:id="_LY-esFsUEeelvIAT-jDSvQ">
<node href="AIL2IAL.henshin#_twxq5VsTEeelvIAT-jDSvQ"/>
</tgg:TAttribute>
<tgg:TNode xmi:id="_KbbRUFsUEeelvIAT-jDSvQ" x="211" y="149">
<tgg:TNode xmi:id="_KbbRUFsUEeelvIAT-jDSvQ" x="205" y="149">
<graph href="AIL2IAL.henshin#_twxq4VsTEeelvIAT-jDSvQ"/>
</tgg:TNode>
<tgg:TNode xmi:id="_OMPQgFsUEeelvIAT-jDSvQ" x="323" y="140">
......
......@@ -56,7 +56,7 @@ public class Models {
return resource.getContents();
} catch (final IOException e) {
// Could not find a method like isLoadable
log.error("Could not load the file "+fileName, e);
log.error("Could not load the file " + fileName, e);
return null;
}
}
......@@ -68,8 +68,11 @@ public class Models {
return targets;
if (eReference.isMany())
targets.addAll((Collection<? extends EObject>) modelElement.eGet(eReference));
else
targets.add((EObject) modelElement.eGet(eReference));
else {
EObject target = (EObject) modelElement.eGet(eReference);
if (target != null)
targets.add(target);
}
return targets;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment