From 532e2c30931aeb44bebc529c4ae0f9abeee9323b Mon Sep 17 00:00:00 2001 From: Peter Feiler Date: Wed, 12 Apr 2017 20:09:38 -0400 Subject: [PATCH] Fixes #129 Only check for subcomponents that have error states as to whether they are included in the composite state declaration. --- .../analysis/actions/ConsistencyAction.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/org.osate.aadl2.errormodel.analysis/src/org/osate/aadl2/errormodel/analysis/actions/ConsistencyAction.java b/org.osate.aadl2.errormodel.analysis/src/org/osate/aadl2/errormodel/analysis/actions/ConsistencyAction.java index 0e66a2cd..5244ad8b 100644 --- a/org.osate.aadl2.errormodel.analysis/src/org/osate/aadl2/errormodel/analysis/actions/ConsistencyAction.java +++ b/org.osate.aadl2.errormodel.analysis/src/org/osate/aadl2/errormodel/analysis/actions/ConsistencyAction.java @@ -691,14 +691,18 @@ protected void checkComponent(ComponentInstance componentInstance, AnalysisModel for (ComponentInstance ci : componentInstance.getComponentInstances()) { boolean found = false; - for (Subcomponent s : subcomponents) { - if (s == ci.getSubcomponent()) { - found = true; + if (EMV2Util.hasComponentErrorBehaviorStates(ci)) { + for (Subcomponent s : subcomponents) { + if (s == ci.getSubcomponent()) { + found = true; + } + } + if (!found) { + error(componentInstance, + "C12: component " + ci.getName() + " is not referenced for state " + + EMV2Util.getPrintName(ebs) + " in component " + + componentInstance.getName()); } - } - if (!found) { - error(componentInstance, "C12: component " + ci.getName() + " is not referenced for state " - + EMV2Util.getPrintName(ebs) + " in component " + componentInstance.getName()); } } }