Skip to content
Snippets Groups Projects
Commit 2a6afeff authored by Michael Leuschel's avatar Michael Leuschel
Browse files

instanceof check before casting to IInvariant


for getting descriptions

Signed-off-by: default avatarMichael Leuschel <leuschel@uni-duesseldorf.de>
parent 6d331493
No related branches found
No related tags found
No related merge requests found
Pipeline #157522 passed
...@@ -580,6 +580,7 @@ public class ModelTranslator extends AbstractComponentTranslator { ...@@ -580,6 +580,7 @@ public class ModelTranslator extends AbstractComponentTranslator {
if (isDefinedHere(evPredicate)) { if (isDefinedHere(evPredicate)) {
final PPredicate predicate = translatePredicate(ff, te, final PPredicate predicate = translatePredicate(ff, te,
evPredicate); evPredicate);
if (evPredicate.getSource() instanceof IInvariant) { // test can fail for generated invariants
final IInvariant ucp = (IInvariant) evPredicate.getSource(); // comments only attached in unchecked source final IInvariant ucp = (IInvariant) evPredicate.getSource(); // comments only attached in unchecked source
if (ucp.hasAttribute(EventBAttributes.COMMENT_ATTRIBUTE)) { if (ucp.hasAttribute(EventBAttributes.COMMENT_ATTRIBUTE)) {
final String commentString = ucp.getAttributeValue(EventBAttributes.COMMENT_ATTRIBUTE); final String commentString = ucp.getAttributeValue(EventBAttributes.COMMENT_ATTRIBUTE);
...@@ -592,6 +593,10 @@ public class ModelTranslator extends AbstractComponentTranslator { ...@@ -592,6 +593,10 @@ public class ModelTranslator extends AbstractComponentTranslator {
} else { } else {
list.add(predicate); list.add(predicate);
labelMapping.put(predicate, evPredicate); labelMapping.put(predicate, evPredicate);
}
} else { // cannot cast source to IInvariant
list.add(predicate);
labelMapping.put(predicate, evPredicate);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment