diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SubqueryImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SubqueryImpl.java index b288055c0..d1dc8c6c1 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SubqueryImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/SubqueryImpl.java @@ -227,7 +227,7 @@ public class SubqueryImpl extends ExpressionImpl implements Subquery { (Members.SingularAttributeImpl)((Joins.SingularJoin)join).getMember(); JoinType jt = join.getJoinType(); FromImpl root = null; - if (parent instanceof RootImpl) { + if (parent instanceof RootImpl) { members.add(member); jts.add(jt); return (FromImpl)parent; @@ -305,8 +305,7 @@ public class SubqueryImpl extends ExpressionImpl implements Subquery { } RootImpl root = (RootImpl)getRoot(); - RootImpl corrRoot = (RootImpl)root.getCorrelatedPath(); - if (corrRoot != null && root.getJoins() != null) { + if (root.getCorrelatedPath() != null && root.getJoins() != null) { FromImpl join = (FromImpl) root.getJoins().iterator().next(); return getInnermostCandidate(join); }