\r
import java.util.Collection;\r
\r
+import org.simantics.graph.compiler.GraphCompilerPreferences;\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.graph.store.StatementCollision;\r
import org.simantics.ltk.Problem;\r
\r
public class ReportCollisions implements Runnable {\r
+ GraphCompilerPreferences preferences;\r
Collection<Problem> problems;\r
GraphStore store;\r
\r
public ReportCollisions(\r
- Collection<Problem> problems,\r
+ GraphCompilerPreferences preferences, Collection<Problem> problems,\r
GraphStore store) {\r
+ this.preferences = preferences;\r
this.problems = problems;\r
this.store = store;\r
}\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
+ "Two template definitions are given for the same resource."));\r
+ if(preferences.validate)\r
+ for(StatementCollision collision : store.statements.getCollisions()) {\r
+ problems.add(new Problem(\r
+ locations.getLocation(collision.subject), \r
+ "The same statement is defined twice: " +\r
+ store.idToRes(collision.predicate) + ", " +\r
+ store.idToRes(collision.object)));\r
+ }\r
}\r
\r
}\r