--- /dev/null
+package org.simantics.graph.compiler.internal.validation;\r
+\r
+import java.util.Collection;\r
+\r
+import org.simantics.graph.compiler.internal.store.LocationStore;\r
+import org.simantics.graph.compiler.internal.templates.TemplateDefinitionStore;\r
+import org.simantics.graph.store.GraphStore;\r
+import org.simantics.ltk.Problem;\r
+\r
+public class ReportCollisions implements Runnable {\r
+ Collection<Problem> problems;\r
+ GraphStore store;\r
+\r
+ public ReportCollisions(\r
+ Collection<Problem> problems,\r
+ GraphStore store) {\r
+ this.problems = problems;\r
+ this.store = store;\r
+ }\r
+ \r
+ @Override\r
+ public void run() {\r
+ LocationStore locations = store.getStore(LocationStore.class);\r
+ for(int c : store.values.getCollisions().toArray())\r
+ problems.add(new Problem(\r
+ locations.getLocation(c), \r
+ "Two literal values are given for the same resource."));\r
+ for(int c : store.identities.getCollisions().toArray())\r
+ problems.add(new Problem(\r
+ locations.getLocation(c), \r
+ "Two different identities are given for the same resource."));\r
+ for(int c : store.getStore(TemplateDefinitionStore.class).getCollisions().toArray())\r
+ problems.add(new Problem(\r
+ locations.getLocation(c), \r
+ "Two tempalate definitions are given for the same resource."));\r
+ }\r
+ \r
+}\r