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

YELLOW

Issue-ref: 4344
Issue-URL: af3#4344



Signed-off-by: default avatarAndreas Bayha <bayha@fortiss.org>
parent ce268473
No related branches found
No related tags found
1 merge request!218Add preparation possibility for reuse providers (incl. specs cleaning)
Pipeline #39624 canceled
Pipeline: maven-releng

#39625

    IReuseProvider.java 51b197baed33d9b247d7775c3f7dc9ab0b693b43 YELLOW
    IReuseProviderService.java f3ef4206581d13795ed9adb65042b4fc9b4370ed YELLOW
    IReuseProvider.java 18d293f7f1f072883188f16fb6eeb52c8d6042cf GREEN
    IReuseProviderService.java bcc70de0bb8d39c330e3a25d884abc7092dc1b7e GREEN
    LayoutedReuseProviderBase.java b0e4ce3cda818b0723ec37b925a4c4c3d0c41909 GREEN
    ReuseProviderBase.java c28607f29113731a7b2e53592a8b03f0f0d632ba YELLOW
    ReuseProviderService.java c4ef33283002d6dac6167f9c6c8f71d2c2ce39d1 YELLOW
    ReuseProviderBase.java 7d03d329b76ae5099c74498e92e06146ecea5560 YELLOW
    ReuseProviderService.java c4ef33283002d6dac6167f9c6c8f71d2c2ce39d1 GREEN
    ......@@ -45,8 +45,8 @@ public class ReuseProviderBase<T extends EObject> implements IReuseProvider<T> {
    /** {@inheritDoc} */
    @Override
    public boolean prepareReuseElementForLibrary(T reuseElement) {
    if(reuseElement instanceof IHierarchicElementContainer) {
    removeUnnecessarySpecifications((IHierarchicElementContainer)reuseElement);
    if(reuseElement instanceof IModelElement) {
    removeVariabilitySpecifications((IModelElement)reuseElement);
    }
    return true;
    }
    ......@@ -105,23 +105,23 @@ public class ReuseProviderBase<T extends EObject> implements IReuseProvider<T> {
    }
    /**
    * Removes unnecessary specifications from the given element and from all of its contained
    * elements. Unnecessary specifications are currently variability-related ones. The method is
    * recursion-based!
    * Removes unnecessary variability specifications from the given element and from all of its
    * contained elements. The method is recursion-based!
    */
    private void removeUnnecessarySpecifications(IHierarchicElementContainer nextElement) {
    private void removeVariabilitySpecifications(IModelElement nextElement) {
    // Removal.
    if(nextElement instanceof IModelElement) {
    OptionalVariationPointSpecification unnecessarySpec =
    getOptVarPointSpecification((IModelElement)nextElement);
    if(unnecessarySpec != null) {
    ((IModelElement)nextElement).getSpecifications().remove(unnecessarySpec);
    }
    OptionalVariationPointSpecification unnecessarySpec =
    getOptVarPointSpecification(nextElement);
    if(unnecessarySpec != null) {
    nextElement.getSpecifications().remove(unnecessarySpec);
    }
    // Recursion.
    for(IHierarchicElement elem : nextElement.getContainedElements()) {
    removeUnnecessarySpecifications(elem);
    if(nextElement instanceof IHierarchicElementContainer) {
    for(IHierarchicElement elem : ((IHierarchicElementContainer)nextElement)
    .getContainedElements()) {
    removeVariabilitySpecifications(elem);
    }
    }
    }
    }
    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