Skip to content
Snippets Groups Projects
Commit 8aea3977 authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Variability: Fixed issue optimized EMF translation

Fixed issue with presence conditions (pc) which were not copied before
being used in new pc.

Issue-ref: 4240
Issue-URL: af3#4240



Signed-off-by: default avatarAndreas Bayha <bayha@fortiss.org>
parent fc315723
No related branches found
No related tags found
1 merge request!1784240
Pipeline #38664 passed
Pipeline: maven-releng

#38665

    package org.fortiss.variability.analysis;
    import static java.util.stream.Collectors.toList;
    import static org.eclipse.emf.ecore.util.EcoreUtil.copy;
    import static org.fortiss.variability.model.VariabilityModelElementFactory.createAndPC;
    import static org.fortiss.variability.util.VariabilityUtilsInternal.getChildrenWithType;
    ......@@ -21,6 +22,7 @@ import org.eclipse.emf.ecore.EEnumLiteral;
    import org.eclipse.emf.ecore.EObject;
    import org.eclipse.emf.ecore.EReference;
    import org.eclipse.emf.ecore.EcorePackage;
    import org.fortiss.tooling.kernel.model.IIdLabeled;
    import org.fortiss.variability.model.IAlternative;
    import org.fortiss.variability.model.IOptionalVariationPoint;
    import org.fortiss.variability.model.features.AbstractAlternativeFeature;
    ......@@ -209,18 +211,18 @@ public class EMFProductLineTranslation implements IProductLineTranslation {
    PresenceConditionTerm pc = getLocalPresenceCondition(model);
    if(pc == null) {
    pc = parentCondition;
    pc = copy(parentCondition);
    } else {
    if(parentCondition != null)
    pc = createAndPC(pc, parentCondition, "");
    pc = createAndPC(copy(pc), copy(parentCondition), "");
    }
    for(EClass cls : translatedClasses) {
    if(cls.isSuperTypeOf(modelClass)) {
    // Only optional objects are translated.
    if(pc != null) {
    collectEObject(model, cls, pc);
    }
    // // Only optional objects are translated.
    // if(pc != null) {
    collectEObject(model, cls, pc);
    // }
    }
    }
    ......@@ -278,7 +280,7 @@ public class EMFProductLineTranslation implements IProductLineTranslation {
    private void collectEObject(EObject eo, EClass cls, PresenceConditionTerm pc) {
    class2TranslatedEObjects.add(cls, eo);
    collectTranslatedReferences(eo);
    // collectTranslatedReferences(eo);
    object2presenceCondition.put(eo, pc);
    }
    ......
    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