SingleObjectWithType was broken in the previous change 69/1569/1
authorMarko Luukkainen <marko.luukkainen@vtt.fi>
Tue, 13 Mar 2018 09:45:48 +0000 (11:45 +0200)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Tue, 13 Mar 2018 09:45:48 +0000 (11:45 +0200)
refs #7803

Change-Id: I4ad3281195144f5f70dd0cc86e2348663d0d1c02

bundles/org.simantics.db.common/src/org/simantics/db/common/request/SingleObjectWithType.java

index a986034889963bf6eedcdd99ff17fc4c3d9d2aef..a95f28728cd04581736cfe2d4f6abd89d14f794d 100644 (file)
@@ -32,12 +32,8 @@ public final class SingleObjectWithType extends ResourceRead3<Resource> {
         int resultCount = 0;
         for (Resource object : graph.getObjects(resource, resource2)) {
             if (graph.isInstanceOf(object, resource3)) {
-                if (result == null) {
-                    result = object;
-                } else {
-                    // okay, too many results but lets calculate for debug
-                    resultCount++;
-                }
+                result = object;
+                resultCount++;
             }
         }