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

YELLOW

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



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

#38910

    BucketSetMap.java 665a28c80a9693b9b9e31b7ebe59f2de4195d56c YELLOW
    DualKeyMap.java 75fbe85a54e5a655aaf67108ae004f98ed2879d8 YELLOW
    EMFProductLineTranslation.java 343224462f35bf0b7300cf32743e4be11fee1ee6 YELLOW
    EMFProductLineTranslation.java c63af9719c1ca45a034ec5beb48e1b35971e40c4 YELLOW
    GenericProductLineAnalysis.java 6f6d48544ec2b872fa0a4f747a85657889ad463e YELLOW
    IProductLineConstraint.java 1b0e1231cc578a6e7e544441ac33533b4feafeb1 YELLOW
    IProductLineTranslation.java 733dae03e2baae237b6f0b33f0dd618a4f47cf73 YELLOW
    ......
    ......@@ -145,7 +145,17 @@ public class EMFProductLineTranslation implements IProductLineTranslation {
    */
    private Map<Expr<?>, EObject> z3Expr2EObject;
    private Map<EObject, Map<EReference, Set<EObject>>> eObject2referencingEObjects;
    /**
    * Maps {@link EObject}s to all incoming references with their source objects each.
    *
    * The following example EObjects and EReferences...
    * srcObj1 --ref1--> trgObj1 <--ref1-- srcObj2
    *
    * ...will be contained here as:
    * trgObj1 -> ( ref1 -> {srcObj1, srcObj2})
    *
    */
    private Map<EObject, BucketSetMap<EReference, EObject>> eObject2referencingEObjects;
    /* Variability related fields */
    /** The {@link AbstractFeatureModel} collected by this translation */
    ......@@ -194,28 +204,15 @@ public class EMFProductLineTranslation implements IProductLineTranslation {
    eObject2z3Expr = new DualKeyMap<EObject, EClass, Expr<?>>();
    z3Expr2EObject = new HashMap<Expr<?>, EObject>();
    eObject2referencingEObjects = new HashMap<EObject, Map<EReference, Set<EObject>>>() {
    eObject2referencingEObjects = new HashMap<EObject, BucketSetMap<EReference, EObject>>() {
    /** {@inheritDoc} */
    @Override
    public Map<EReference, Set<EObject>> get(Object key1) {
    Map<EReference, Set<EObject>> retMap = super.get(key1);
    public BucketSetMap<EReference, EObject> get(Object key1) {
    BucketSetMap<EReference, EObject> retMap = super.get(key1);
    // In case the bucket map does not yet exist, it is initialized, here.
    if(retMap == null) {
    retMap = new HashMap<EReference, Set<EObject>>() {
    /** {@inheritDoc} */
    @Override
    public Set<EObject> get(Object key) {
    Set<EObject> retSet = super.get(key);
    if(retSet == null) {
    retSet = new HashSet<EObject>();
    super.put((EReference)key, retSet);
    }
    return retSet;
    }
    };
    retMap = new BucketSetMap<EReference, EObject>();
    super.put((EObject)key1, retMap);
    }
    ......@@ -240,7 +237,6 @@ public class EMFProductLineTranslation implements IProductLineTranslation {
    initialize();
    // Reference types need to be collected first, since they are required by optimizations in
    // collectTranslatedObjects().
    collectReferenceTypes();
    collectTranslatedObjects(model, null);
    ......@@ -248,8 +244,6 @@ public class EMFProductLineTranslation implements IProductLineTranslation {
    collectReferencedIslandObjects();
    }
    translateFeatureModel();
    // Metamodel translation
    translateClassesMetamodel();
    translateAttributesAndReferencesMetamodel();
    ......@@ -258,6 +252,7 @@ public class EMFProductLineTranslation implements IProductLineTranslation {
    translateObjects();
    // Translate variability
    translateFeatureModel();
    translatePresenceConditions();
    }
    ......@@ -347,11 +342,9 @@ public class EMFProductLineTranslation implements IProductLineTranslation {
    for(EReference ref : refSource.eClass().getEAllReferences()) {
    if(translatedReferences.contains(ref)) {
    EObject refTarget = (EObject)refSource.eGet(ref);
    Map<EReference, Set<EObject>> referencingObj =
    BucketSetMap<EReference, EObject> referencingObj =
    eObject2referencingEObjects.get(refTarget);
    Set<EObject> refSet = referencingObj.get(ref);
    refSet.add(refSource);
    referencingObj.add(ref, refSource);
    }
    }
    }
    ......@@ -388,7 +381,8 @@ public class EMFProductLineTranslation implements IProductLineTranslation {
    }
    // Collect incoming references
    Map<EReference, Set<EObject>> incomingReferences = eObject2referencingEObjects.get(model);
    BucketSetMap<EReference, EObject> incomingReferences =
    eObject2referencingEObjects.get(model);
    for(EReference ref : incomingReferences.keySet()) {
    for(EObject srcObj : incomingReferences.get(ref)) {
    EClass srcObjTransClass = getTranslatedClass(srcObj.eClass());
    ......
    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