From b86cd8a694671ca24a8b76db4db8071f8b3cd85e Mon Sep 17 00:00:00 2001 From: Antti Villberg Date: Wed, 9 Nov 2016 11:58:38 +0200 Subject: [PATCH] Fixed to remove duplicates refs #6797 Change-Id: Ifb3bd95855c47b3cf424a1ec7ee5364b3aef4597 --- .../org/simantics/db/layer0/adapter/impl/EntityInstances.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/EntityInstances.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/EntityInstances.java index 428b96a5d..32a7d2a9f 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/EntityInstances.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/EntityInstances.java @@ -174,8 +174,10 @@ public class EntityInstances implements Instances { public Collection find(ReadGraph graph, Resource index, String filter) throws DatabaseException { CollectionSupport coll = graph.getService(CollectionSupport.class); - List rec = findRec(graph, index, filter, new THashSet()); + THashSet visited = new THashSet<>(); + List rec = findRec(graph, index, filter, visited); for(Resource global : Layer0Utils.listGlobalOntologies(graph)) { + if(!visited.add(global)) continue; List rs = graph.syncRequest(new QueryIndex(global, type, filter), TransientCacheListener.>instance()); if(rec.isEmpty() && !rs.isEmpty()) { // TODO: rec could be an immutable empty list -- 2.47.1