From: villberg Date: Wed, 30 Nov 2011 10:38:25 +0000 (+0000) Subject: Corrections to issue listening X-Git-Tag: simantics-1.6~87 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=3cf67c0db1ca048ebc1d2627836795d7a3903fe4;p=simantics%2Fsysdyn.git Corrections to issue listening git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@23374 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java index 1498e230..9828a94e 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java @@ -77,23 +77,23 @@ public class DependencyFunction { ArrayList result = new ArrayList(); - StandardIssue noSuchVariableIssue = null; - // Check that all references have corresponding arrows - if(references != null && dependencies != null) { - for(String reference : references) { - if(!dependencies.contains(reference)) { - Resource variable = null; - if((variable = ValidationUtils.reach(graph, component, reference)) != null) { - result.add(new StandardIssue(sr.Validations_MissingLinkIssue, component, variable)); - } else { - if(noSuchVariableIssue == null) { +// StandardIssue noSuchVariableIssue = null; +// // Check that all references have corresponding arrows +// if(references != null && dependencies != null) { +// for(String reference : references) { +// if(!dependencies.contains(reference)) { +// Resource variable = null; +// if((variable = ValidationUtils.reach(graph, component, reference)) != null) { +// result.add(new StandardIssue(sr.Validations_MissingLinkIssue, component, variable)); +// } else { +// if(noSuchVariableIssue == null) { // noSuchVariableIssue = new StandardIssue(sr.Validations_NoSuchVariableIssue, component); // result.add(noSuchVariableIssue); - } - } - } - } - } +// } +// } +// } +// } +// } // Check that all arrow dependencies are used in equations if(dependencies != null) { @@ -144,18 +144,27 @@ public class DependencyFunction { } catch (UndefinedExpressionException e) { } + ArrayList result = new ArrayList(); + + StandardIssue noSuchVariableIssue = null; // Check that all references have corresponding arrows if(references != null && dependencies != null) { for(String reference : references) { if(!dependencies.contains(reference)) { - if(ValidationUtils.reach(graph, component, reference) == null) { - return Collections.singletonList(new StandardIssue(sr.Validations_NoSuchVariableIssue, component)); + Resource variable = null; + if((variable = ValidationUtils.reach(graph, component, reference)) != null) { + result.add(new StandardIssue(sr.Validations_MissingLinkIssue, component, variable)); + } else { + if(noSuchVariableIssue == null) { + noSuchVariableIssue = new StandardIssue(sr.Validations_NoSuchVariableIssue, component); + result.add(noSuchVariableIssue); + } } } } } - return Collections.emptyList(); + return result; }