diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java index fb17730c2..fed646a71 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java @@ -558,7 +558,7 @@ public class FetchConfigurationImpl // see if there's a previous limit int avail = Integer.MIN_VALUE; for (FetchConfigurationImpl f = this; f != null; f = f._parent) { - if (ImplHelper.isAssignable(type, f._fromType)) { + if (ImplHelper.isAssignable(f._fromType, type)) { avail = f._availableRecursion; if (traverse) avail = reduce(avail); diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java index 415c07bb9..a3c44bd35 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java @@ -205,11 +205,11 @@ public class ImplHelper { * @return true if the "to" class is assignable to the "from" class */ public static boolean isAssignable(Class from, Class to) { - Boolean isAssignable = null; if (from == null || to == null) return false; - Map assignableTo = (Map) _assignableTypes.get(from); + Boolean isAssignable = null; + Map assignableTo = (Map) _assignableTypes.get(from); if (assignableTo == null) { // "to" cache doesn't exist, so create it... assignableTo = new ConcurrentHashMap(); _assignableTypes.put(from, assignableTo); @@ -218,7 +218,7 @@ public class ImplHelper { } if (isAssignable == null) {// we don't have a record of this pair... - isAssignable = new Boolean(from.isAssignableFrom(to)); + isAssignable = Boolean.valueOf(from.isAssignableFrom(to)); assignableTo.put(to, isAssignable); } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java index f2c081b20..92749f173 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java @@ -28,15 +28,16 @@ import org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashMap; public abstract class OpenJPAId implements Comparable, Serializable { + // cache the types' generated hashcodes + private static ConcurrentReferenceHashMap _typeCache = + new ConcurrentReferenceHashMap(ReferenceMap.WEAK, ReferenceMap.HARD); + protected Class type; protected boolean subs = true; // type has his based on the least-derived non-object class so that // user-given ids with non-exact types match ids with exact types private transient int _typeHash = 0; - // cache the types' generated hashcodes - private static ConcurrentReferenceHashMap _typeCache = - new ConcurrentReferenceHashMap(ReferenceMap.WEAK, ReferenceMap.HARD); protected OpenJPAId() { }