]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Corrections to issue listening
authorvillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 30 Nov 2011 10:38:25 +0000 (10:38 +0000)
committervillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 30 Nov 2011 10:38:25 +0000 (10:38 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@23374 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java

index 1498e2303c02aa0db672b804ab5d61b6eab798b9..9828a94ed6183ef648bb142529c07bbf448faa68 100644 (file)
@@ -77,23 +77,23 @@ public class DependencyFunction {
         ArrayList<Issue> result = new ArrayList<Issue>();\r
 \r
 \r
-        StandardIssue noSuchVariableIssue = null;\r
-        // Check that all references have corresponding arrows\r
-        if(references != null && dependencies != null) {\r
-            for(String reference : references) {\r
-                if(!dependencies.contains(reference)) {\r
-                    Resource variable = null;\r
-                    if((variable = ValidationUtils.reach(graph, component, reference)) != null) {\r
-                        result.add(new StandardIssue(sr.Validations_MissingLinkIssue, component, variable));\r
-                    } else {\r
-                        if(noSuchVariableIssue == null) {\r
+//        StandardIssue noSuchVariableIssue = null;\r
+//        // Check that all references have corresponding arrows\r
+//        if(references != null && dependencies != null) {\r
+//            for(String reference : references) {\r
+//                if(!dependencies.contains(reference)) {\r
+//                    Resource variable = null;\r
+//                    if((variable = ValidationUtils.reach(graph, component, reference)) != null) {\r
+//                        result.add(new StandardIssue(sr.Validations_MissingLinkIssue, component, variable));\r
+//                    } else {\r
+//                        if(noSuchVariableIssue == null) {\r
 //                            noSuchVariableIssue = new StandardIssue(sr.Validations_NoSuchVariableIssue, component);\r
 //                            result.add(noSuchVariableIssue);\r
-                        }\r
-                    }\r
-                } \r
-            }\r
-        }\r
+//                        }\r
+//                    }\r
+//                } \r
+//            }\r
+//        }\r
 \r
         // Check that all arrow dependencies are used in equations\r
         if(dependencies != null) {\r
@@ -144,18 +144,27 @@ public class DependencyFunction {
         } catch (UndefinedExpressionException e) {\r
         }\r
 \r
+        ArrayList<Issue> result = new ArrayList<Issue>();\r
+\r
+        StandardIssue noSuchVariableIssue = null;\r
         // Check that all references have corresponding arrows\r
         if(references != null && dependencies != null) {\r
             for(String reference : references) {\r
                 if(!dependencies.contains(reference)) {\r
-                    if(ValidationUtils.reach(graph, component, reference) == null) {\r
-                        return Collections.<Issue>singletonList(new StandardIssue(sr.Validations_NoSuchVariableIssue, component));\r
+                    Resource variable = null;\r
+                    if((variable = ValidationUtils.reach(graph, component, reference)) != null) {\r
+                        result.add(new StandardIssue(sr.Validations_MissingLinkIssue, component, variable));\r
+                    } else {\r
+                        if(noSuchVariableIssue == null) {\r
+                            noSuchVariableIssue = new StandardIssue(sr.Validations_NoSuchVariableIssue, component);\r
+                            result.add(noSuchVariableIssue);\r
+                        }\r
                     }\r
                 } \r
             }\r
         }\r
 \r
-        return Collections.emptyList();\r
+        return result;\r
         \r
     }\r
     \r