Skip to content
Snippets Groups Projects
Commit ac82aba9 authored by Sebastian Bergemann's avatar Sebastian Bergemann
Browse files

GREEN + comment/name fixes, etc. (not final for merge!)

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



Signed-off-by: default avatarSebastian Bergemann <bergemann@fortiss.org>
parent c88960a8
No related branches found
No related tags found
1 merge request!1784240
Pipeline #39321 failed
Showing
with 54 additions and 36 deletions
OptimizedProductLineAnalysisBase.java 94cb2d0d254f3e50f21ca039b6784e1a26c4d91c YELLOW OptimizedProductLineAnalysisBase.java 35a40c860cc8a9774a894600935c1ae89a5681a0 GREEN
OptimizedProductLineTranslation.java ad12974d9e19fc88e3240d6a4c2306004d0a3b39 YELLOW OptimizedProductLineTranslation.java 415361dd35a04db219b06a1e40079452d7079b34 GREEN
ProductLineAnalysisBase.java 891235573a2102279256585f8dc31934240b8dc1 GREEN ProductLineAnalysisBase.java 891235573a2102279256585f8dc31934240b8dc1 GREEN
ProductLineTranslationBase.java f24fb9343003c025bc4d2292d15bca543a548749 GREEN ProductLineTranslationBase.java f24fb9343003c025bc4d2292d15bca543a548749 GREEN
...@@ -25,9 +25,7 @@ import org.fortiss.variability.analysis.GenericProductLineAnalysis; ...@@ -25,9 +25,7 @@ import org.fortiss.variability.analysis.GenericProductLineAnalysis;
*/ */
public abstract class OptimizedProductLineAnalysisBase extends GenericProductLineAnalysis { public abstract class OptimizedProductLineAnalysisBase extends GenericProductLineAnalysis {
/** /** Constructor. */
* Constructor.
*/
public OptimizedProductLineAnalysisBase(EObject model) { public OptimizedProductLineAnalysisBase(EObject model) {
super(model, new OptimizedProductLineTranslation()); super(model, new OptimizedProductLineTranslation());
} }
......
...@@ -74,7 +74,7 @@ public class OptimizedProductLineTranslation extends EMFProductLineTranslation { ...@@ -74,7 +74,7 @@ public class OptimizedProductLineTranslation extends EMFProductLineTranslation {
collectPresenceCondition(eo, pc); collectPresenceCondition(eo, pc);
// Also collect depending elements for the tooling kernel implementation // Also collect depending elements for the tooling kernel implementation.
List<EObject> dependingElements = List<EObject> dependingElements =
IDependingElementProviderService.getInstance().getDependingElements(eo); IDependingElementProviderService.getInstance().getDependingElements(eo);
for(EObject depObj : dependingElements) { for(EObject depObj : dependingElements) {
......
ActionService.java e29126b5947c9fd2f1d82bb87001b9d0ead50c3b GREEN ActionService.java e29126b5947c9fd2f1d82bb87001b9d0ead50c3b GREEN
ContextMenuService.java 752ecb95721c4ff31583095bdb06b71ef28c4dcf GREEN ContextMenuService.java 752ecb95721c4ff31583095bdb06b71ef28c4dcf GREEN
MarkerService.java 92c9e7410a39040554473bd59d7b75a76ad47f97 YELLOW MarkerService.java 5cc84f9c1e9811100fad92c0abfa934613173c06 GREEN
ModelEditorBindingService.java f304addb514cd2de443997e0b52cef7a3a9897bf GREEN ModelEditorBindingService.java f304addb514cd2de443997e0b52cef7a3a9897bf GREEN
ModelElementHandlerService.java 34adeef844bf98c69f1b9a7252f34d0a2b741b54 GREEN ModelElementHandlerService.java 34adeef844bf98c69f1b9a7252f34d0a2b741b54 GREEN
NavigatorService.java 1d773dde3791ddf7051616fe249558e7e307757d GREEN NavigatorService.java 1d773dde3791ddf7051616fe249558e7e307757d GREEN
......
...@@ -182,7 +182,7 @@ public class MarkerService implements IMarkerService, IPersistencyServiceListene ...@@ -182,7 +182,7 @@ public class MarkerService implements IMarkerService, IPersistencyServiceListene
List<IConstraintViolation<? extends EObject>> checkResult = List<IConstraintViolation<? extends EObject>> checkResult =
ccs.performAllConstraintChecksRecursively(rootModelElement); ccs.performAllConstraintChecksRecursively(rootModelElement);
ccs.performAllAsynchronousConstrintChecksRecursively(rootModelElement, violations -> { ccs.performAllAsynchronousConstraintChecksRecursively(rootModelElement, violations -> {
synchronized(violationCache) { synchronized(violationCache) {
CacheEntry entry = getCacheEntry(element); CacheEntry entry = getCacheEntry(element);
entry.addNewViolations(violations); entry.addNewViolations(violations);
......
CommandLineInterfaceService.java 6b5c94c52702f773c60b181eff52204ab379b248 GREEN CommandLineInterfaceService.java 6b5c94c52702f773c60b181eff52204ab379b248 GREEN
CommandStackService.java 957bda69b5feb91f002aed4d25ed334e92801e7e GREEN CommandStackService.java 957bda69b5feb91f002aed4d25ed334e92801e7e GREEN
ConnectionCompositorService.java 5a52f8a3e88c167ae6909c3d9eb3fb4706177e8b GREEN ConnectionCompositorService.java 5a52f8a3e88c167ae6909c3d9eb3fb4706177e8b GREEN
ConstraintCheckerService.java 1aa6cc382b7fa764ae3fcda9fb4c19bdf5f74806 YELLOW ConstraintCheckerService.java 590cd592008139586f98911ecb675449a5b3c8e1 GREEN
DummyTopLevelElement.java 21807bbdafec2e0ef28f0ee9090218f90bd73aee GREEN DummyTopLevelElement.java 21807bbdafec2e0ef28f0ee9090218f90bd73aee GREEN
ElementCompositorService.java b1924b5b349118a70149cfac5b48544897d26e9e GREEN ElementCompositorService.java b1924b5b349118a70149cfac5b48544897d26e9e GREEN
LoggingService.java da784259f7b456b54bf75c41ec268f64919ce78d GREEN LoggingService.java da784259f7b456b54bf75c41ec268f64919ce78d GREEN
......
...@@ -60,6 +60,7 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain ...@@ -60,6 +60,7 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain
Map<Class<?>, List<IConstraintChecker<EObject>>> asynchronousConstraintCheckers = Map<Class<?>, List<IConstraintChecker<EObject>>> asynchronousConstraintCheckers =
new HashMap<Class<?>, List<IConstraintChecker<EObject>>>(); new HashMap<Class<?>, List<IConstraintChecker<EObject>>>();
/** Maps all constraint checkers to their identifier. */
Map<IConstraintChecker<? extends EObject>, String> asynchronousCheckIdentifiers = Map<IConstraintChecker<? extends EObject>, String> asynchronousCheckIdentifiers =
new HashMap<IConstraintChecker<? extends EObject>, String>(); new HashMap<IConstraintChecker<? extends EObject>, String>();
...@@ -178,18 +179,18 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain ...@@ -178,18 +179,18 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void performAllAsynchronousConstrintChecksRecursively(EObject modelElement, public void performAllAsynchronousConstraintChecksRecursively(EObject modelElement,
Consumer<List<IConstraintViolation<? extends EObject>>> addMarkers) { Consumer<List<IConstraintViolation<? extends EObject>>> addMarkers) {
performAllAsynchronousConstrintChecks(modelElement, addMarkers); performAllAsynchronousConstraintChecks(modelElement, addMarkers);
for(Iterator<EObject> iter = modelElement.eAllContents(); iter.hasNext();) { for(Iterator<EObject> iter = modelElement.eAllContents(); iter.hasNext();) {
performAllAsynchronousConstrintChecks(iter.next(), addMarkers); performAllAsynchronousConstraintChecks(iter.next(), addMarkers);
} }
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void performAllAsynchronousConstrintChecks(EObject modelElement, public void performAllAsynchronousConstraintChecks(EObject modelElement,
Consumer<List<IConstraintViolation<? extends EObject>>> addMarkers) { Consumer<List<IConstraintViolation<? extends EObject>>> addMarkers) {
List<IConstraintChecker<EObject>> asyncHandlers = List<IConstraintChecker<EObject>> asyncHandlers =
performNearestClassLookup(modelElement.getClass(), asynchronousConstraintCheckers); performNearestClassLookup(modelElement.getClass(), asynchronousConstraintCheckers);
......
ICommandLineInterfaceService.java c3e3ba08b2a1b8125b43abd1c29b7dc0a0be2b80 GREEN ICommandLineInterfaceService.java c3e3ba08b2a1b8125b43abd1c29b7dc0a0be2b80 GREEN
ICommandStackService.java 678dcd1a6ab435ed0870fa2a9ec48ce47f25a187 GREEN ICommandStackService.java 678dcd1a6ab435ed0870fa2a9ec48ce47f25a187 GREEN
IConnectionCompositorService.java 0cdf4568b2cd3e95ea195df90a84699eff36442b GREEN IConnectionCompositorService.java 0cdf4568b2cd3e95ea195df90a84699eff36442b GREEN
IConstraintCheckerService.java 09046a5c27dfe08fd40f0a6587e3c561edb2127e YELLOW IConstraintCheckerService.java 7fdce90a3b6df1ebba709f8382a1c37d0cffb2e3 GREEN
IEclipseResourceStorageService.java b1155ca15cd9474d4d533d6cb2725e8a22040ec9 GREEN IEclipseResourceStorageService.java b1155ca15cd9474d4d533d6cb2725e8a22040ec9 GREEN
IElementCompositorService.java acd462ec15f3bcc247b544b46ceebee971fe1408 GREEN IElementCompositorService.java acd462ec15f3bcc247b544b46ceebee971fe1408 GREEN
IKernelIntrospectionSystemService.java 7005c3acb4c6f978729d93279c595765e94e38eb GREEN IKernelIntrospectionSystemService.java 7005c3acb4c6f978729d93279c595765e94e38eb GREEN
......
...@@ -49,7 +49,8 @@ public interface IConstraintCheckerService { ...@@ -49,7 +49,8 @@ public interface IConstraintCheckerService {
performAllConstraintChecksRecursively(EObject modelElement); performAllConstraintChecksRecursively(EObject modelElement);
/** /**
* Performs all registered asynchronous constraint checks for the given modelElement and all its * Performs all registered asynchronous constraint checks for the given {@link EObject} and all
* its
* contained child elements. * contained child elements.
* *
* @param modelElement * @param modelElement
...@@ -58,11 +59,11 @@ public interface IConstraintCheckerService { ...@@ -58,11 +59,11 @@ public interface IConstraintCheckerService {
* A {@link Consumer} to receive all constraint violations from the asynchronous * A {@link Consumer} to receive all constraint violations from the asynchronous
* checks. * checks.
*/ */
void performAllAsynchronousConstrintChecksRecursively(EObject modelElement, void performAllAsynchronousConstraintChecksRecursively(EObject modelElement,
Consumer<List<IConstraintViolation<? extends EObject>>> addMarkers); Consumer<List<IConstraintViolation<? extends EObject>>> addMarkers);
/** /**
* Performs all registered asynchronous constraint checks for the given modelElement. * Performs all registered asynchronous constraint checks for the given {@link EObject}.
* *
* @param modelElement * @param modelElement
* The {@link EObject} for which all checks shall be performed. * The {@link EObject} for which all checks shall be performed.
...@@ -70,7 +71,7 @@ public interface IConstraintCheckerService { ...@@ -70,7 +71,7 @@ public interface IConstraintCheckerService {
* A {@link Consumer} to receive all constraint violations from the asynchronous * A {@link Consumer} to receive all constraint violations from the asynchronous
* checks. * checks.
*/ */
void performAllAsynchronousConstrintChecks(EObject modelElement, void performAllAsynchronousConstraintChecks(EObject modelElement,
Consumer<List<IConstraintViolation<? extends EObject>>> addMarkers); Consumer<List<IConstraintViolation<? extends EObject>>> addMarkers);
/** /**
......
variability.ecore 46e8f19e62bf23c1897ad71d15ed830f01cd1ce9 YELLOW variability.ecore 46e8f19e62bf23c1897ad71d15ed830f01cd1ce9 GREEN
BucketSetMap.java 665a28c80a9693b9b9e31b7ebe59f2de4195d56c YELLOW BucketSetMap.java 665a28c80a9693b9b9e31b7ebe59f2de4195d56c GREEN
DualKeyMap.java 75fbe85a54e5a655aaf67108ae004f98ed2879d8 YELLOW DualKeyMap.java 75fbe85a54e5a655aaf67108ae004f98ed2879d8 GREEN
EMFProductLineTranslation.java a62c588bd806fdf98d1e2fb4138c359528edcaad YELLOW EMFProductLineTranslation.java a62c588bd806fdf98d1e2fb4138c359528edcaad YELLOW
GenericProductLineAnalysis.java 314f4de5be3ac7f6589192e7b41540153e032199 YELLOW GenericProductLineAnalysis.java 859b58aef54101734de849db293de79e16054098 GREEN
GenericProductLineTranslation.java 2df1a1c1363cb93b6f498308e575833cf705e2fd GREEN GenericProductLineTranslation.java 2df1a1c1363cb93b6f498308e575833cf705e2fd GREEN
IProductLineConstraint.java 1b0e1231cc578a6e7e544441ac33533b4feafeb1 YELLOW IProductLineConstraint.java 1b0e1231cc578a6e7e544441ac33533b4feafeb1 GREEN
IProductLineTranslation.java 733dae03e2baae237b6f0b33f0dd618a4f47cf73 YELLOW IProductLineTranslation.java 733dae03e2baae237b6f0b33f0dd618a4f47cf73 GREEN
ProductLineConstraintBase.java 04097c7c31367fdd11a054ba2b259a0535a313f4 YELLOW ProductLineConstraintBase.java 04097c7c31367fdd11a054ba2b259a0535a313f4 GREEN
ProductLineConstraintViolation.java c31e257f99288e913a58805b2ccdfa906bf91f29 YELLOW ProductLineConstraintViolation.java 2a2bd9341e0b8f407ad9b4c663b507bd10d083ea GREEN
package org.fortiss.variability.analysis; package org.fortiss.variability.analysis;
import static com.microsoft.z3.Status.SATISFIABLE;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
...@@ -68,8 +70,8 @@ public abstract class GenericProductLineAnalysis { ...@@ -68,8 +70,8 @@ public abstract class GenericProductLineAnalysis {
List<ProductLineConstraintViolation> ret = new ArrayList<ProductLineConstraintViolation>(); List<ProductLineConstraintViolation> ret = new ArrayList<ProductLineConstraintViolation>();
if(result.equals(Status.SATISFIABLE)) { if(result.equals(SATISFIABLE)) {
// A violating configuration (i.e. model for negated constraints) was found -> extract // A violating configuration (i.e., model for negated constraints) was found -> extract
// violating model elements. // violating model elements.
Model z3Model = solver.getModel(); Model z3Model = solver.getModel();
......
...@@ -33,7 +33,7 @@ public class ProductLineConstraintViolation { ...@@ -33,7 +33,7 @@ public class ProductLineConstraintViolation {
/** The violated constraint. */ /** The violated constraint. */
protected IProductLineConstraint constraint; protected IProductLineConstraint constraint;
/** The configuration which will reuslt in a model variant which violates the constraint. */ /** The configuration which will result in a model variant which violates the constraint. */
private VariantConfiguration violatingConfiguration; private VariantConfiguration violatingConfiguration;
/** Constructor. */ /** Constructor. */
...@@ -44,22 +44,38 @@ public class ProductLineConstraintViolation { ...@@ -44,22 +44,38 @@ public class ProductLineConstraintViolation {
this.violatingConfiguration = violatingConfiguration; this.violatingConfiguration = violatingConfiguration;
} }
/** Returns the elements which causes the violation. */ /**
* Returns the elements which causes the violation.
*
* @return The elements which causes the violation.
*/
public List<EObject> getViolatingElements() { public List<EObject> getViolatingElements() {
return violatingElements; return violatingElements;
} }
/** Returns the error message. */ /**
* Returns the error message.
*
* @return The error message.
*/
public String getErrorMessage() { public String getErrorMessage() {
return constraint.createErrorMessage(violatingElements, violatingConfiguration); return constraint.createErrorMessage(violatingElements, violatingConfiguration);
} }
/** Returns the constraint that has been violated. */ /**
* Returns the constraint that has been violated.
*
* @return The constraint that has been violated.
*/
public IProductLineConstraint getConstraint() { public IProductLineConstraint getConstraint() {
return constraint; return constraint;
} }
/** Returns the configuration which will violate the constraint. */ /**
* Returns the configuration which will violate the constraint.
*
* @return The configuration which will violate the constraint.
*/
public VariantConfiguration getViolatingConfiguration() { public VariantConfiguration getViolatingConfiguration() {
return violatingConfiguration; return violatingConfiguration;
} }
......
VariabilityModelElementFactory.java 5a50d78b0fc94a20329b95991b519a3e3fbf4410 GREEN VariabilityModelElementFactory.java 5a50d78b0fc94a20329b95991b519a3e3fbf4410 GREEN
VariabilityStaticImpl.java 9d913de8c14b22b07d318084abd911c6d5692977 YELLOW VariabilityStaticImpl.java 9d913de8c14b22b07d318084abd911c6d5692977 GREEN
FeatureModelTransformationUtils.java b38702296dcb48ff311b382bb9c05d2590e2dfac GREEN FeatureModelTransformationUtils.java b38702296dcb48ff311b382bb9c05d2590e2dfac GREEN
Pair.java 2dfd7dc65f7b9ba09a120f1a6058d1e8e9556a37 GREEN Pair.java 2dfd7dc65f7b9ba09a120f1a6058d1e8e9556a37 GREEN
VariabilityUtils.java 3e57a37ced6396076c71227aea8de534381b6ace GREEN VariabilityUtils.java 3e57a37ced6396076c71227aea8de534381b6ace GREEN
VariabilityUtilsInternal.java c5a4c445e73a15826882361a75b5dca201c3ca91 YELLOW VariabilityUtilsInternal.java 612c248ae391aeeb0ad80a23abc50974004c5349 GREEN
...@@ -237,7 +237,7 @@ public class VariabilityUtilsInternal { ...@@ -237,7 +237,7 @@ public class VariabilityUtilsInternal {
/** /**
* Calculates a self contained presence condition of the given element which takes into account * Calculates a self contained presence condition of the given element which takes into account
* all presence conditions of parent objects in the containment hierarchy * all presence conditions of parent objects in the containment hierarchy.
* *
* Note, that this util method should only be used internally in this plugin, as the variation * Note, that this util method should only be used internally in this plugin, as the variation
* point implementation could be different in higher level plugins. * point implementation could be different in higher level plugins.
......
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