From: Marko Luukkainen Date: Tue, 13 Mar 2018 09:45:48 +0000 (+0200) Subject: SingleObjectWithType was broken in the previous change X-Git-Tag: v1.43.0~136^2~543 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F1569%2F1;p=simantics%2Fplatform.git SingleObjectWithType was broken in the previous change refs #7803 Change-Id: I4ad3281195144f5f70dd0cc86e2348663d0d1c02 --- diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/request/SingleObjectWithType.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/request/SingleObjectWithType.java index a98603488..a95f28728 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/request/SingleObjectWithType.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/request/SingleObjectWithType.java @@ -32,12 +32,8 @@ public final class SingleObjectWithType extends ResourceRead3 { 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++; } }