Commit e54b72f7 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

DSE patterns: Resolve NPE if safety constraints are defined

Issue-Ref: 3885
Issue-Url: https://af3-developer.fortiss.org/issues/3885

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent d951f5e8
......@@ -4,7 +4,7 @@ BasicScheduleConstraint.java 8c64023fd01bcf858218e322f020aceff3661d98 GREEN
ConstraintDefinitionUtils.java a51705fb421fd2d1d3c2a9b74a055947f7e70e98 GREEN
ConstraintTransformationAdapter.java 8806164d71491c7d1af665990dd154f2275cad8c GREEN
DSMLTransformationService.java 2344a468547413121ba43a12556c38812a63de5f GREEN
DSMLtoSMTTransformator.java 7e1e4cbcf8c5acdb2b82fd7a266fb8c38f787f00 GREEN
DSMLtoSMTTransformator.java 2a9b4efa2210a4a1da5c2b4328fd99cfe928028b YELLOW
DefaultExpressionTransformator.java 47e3c00647a2a9845d1c0785668f6270cf06517e GREEN
DeploScheduleRun.java 2b07bd6b40cf4ce2eabc12198f6db3b9655bed25 GREEN
DeploymentRun.java 4b2d0a6d64bb5a6efabc2ee9bf933cc523843ac8 GREEN
......
......@@ -483,7 +483,10 @@ public class DSMLtoSMTTransformator {
Expr valueExpr = null;
if(annotation instanceof SafetyIntegrityLevel) {
Enumerator value = ((SafetyIntegrityLevel)annotation).getValue();
valueExpr = createInteger(context, value.getValue());
// Null implies no safety level defined --> Lowest safety level. A different and
// cleaner approach to solve this problem is implemented in #3690.
valueExpr = (value != null) ? createInteger(context, value.getValue())
: createInteger(context, 0);
} else if(annotation instanceof HardwareCost) {
int value = ((HardwareCost)annotation).getCost();
valueExpr = createInteger(context, value);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment