1 package org.simantics.graph.compiler.internal.validation;
\r
3 import java.util.Collection;
\r
5 import org.simantics.graph.compiler.internal.store.LocationStore;
\r
6 import org.simantics.graph.compiler.internal.templates.TemplateDefinitionStore;
\r
7 import org.simantics.graph.store.GraphStore;
\r
8 import org.simantics.ltk.Problem;
\r
10 public class ReportCollisions implements Runnable {
\r
11 Collection<Problem> problems;
\r
14 public ReportCollisions(
\r
15 Collection<Problem> problems,
\r
17 this.problems = problems;
\r
23 LocationStore locations = store.getStore(LocationStore.class);
\r
24 for(int c : store.values.getCollisions().toArray())
\r
25 problems.add(new Problem(
\r
26 locations.getLocation(c),
\r
27 "Two literal values are given for the same resource."));
\r
28 for(int c : store.identities.getCollisions().toArray())
\r
29 problems.add(new Problem(
\r
30 locations.getLocation(c),
\r
31 "Two different identities are given for the same resource."));
\r
32 for(int c : store.getStore(TemplateDefinitionStore.class).getCollisions().toArray())
\r
33 problems.add(new Problem(
\r
34 locations.getLocation(c),
\r
35 "Two tempalate definitions are given for the same resource."));
\r