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