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

Variability: Fixed presence condition property section


There was an unnecessary model change for the case in which a element
without a pc was assignes an empty pc. The model is not changed / dirty,
now.

Issue-ref: 4273
Issue-URL: af3#4273

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

#37111

    This commit is part of merge request !189. Comments created here will be created in the context of that merge request.
    VariabilityUtils.java 6bab655b72f9b2e53c9dd14b9ea7981cabc5493a YELLOW VariabilityUtils.java 3a10f28d57ca4da70b6236b74bd682fa8b03582a YELLOW
    ...@@ -177,7 +177,14 @@ public class VariabilityUtils { ...@@ -177,7 +177,14 @@ public class VariabilityUtils {
    final OptionalVariationPointSpecification finalSpec = spec; final OptionalVariationPointSpecification finalSpec = spec;
    // Change model only, if the new presence condition is different from the old one // Change model only, if the new presence condition is different from the old one
    PresenceCondition oldPC = spec.getPresenceCondition(); PresenceCondition oldPC = spec.getPresenceCondition();
    if(oldPC == null || !oldPC.getStringRepresentation().equals(pc.getStringRepresentation())) {
    // If both pc are null, there is nothing to change
    if(oldPC == null && pc == null) {
    return true;
    }
    // Check whether the old and new are different (i.e. one being null or different value)
    if(oldPC == null || pc == null ||
    !oldPC.getStringRepresentation().equals(pc.getStringRepresentation())) {
    ICommandStackService.getInstance().runAsCommand(elem, ICommandStackService.getInstance().runAsCommand(elem,
    () -> finalSpec.setPresenceCondition(pc)); () -> finalSpec.setPresenceCondition(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