OPENJPA-2346: Minor performance improvement to MetaDataRepository.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1452872 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Richard G. Curtis 2013-03-05 16:09:21 +00:00
parent ecd1246c80
commit 80d1fddb75
1 changed files with 17 additions and 15 deletions

View File

@ -39,8 +39,8 @@ import org.apache.openjpa.conf.OpenJPAConfiguration;
import org.apache.openjpa.enhance.DynamicPersistenceCapable;
import org.apache.openjpa.enhance.PCEnhancer;
import org.apache.openjpa.enhance.PCRegistry;
import org.apache.openjpa.enhance.PersistenceCapable;
import org.apache.openjpa.enhance.PCRegistry.RegisterClassListener;
import org.apache.openjpa.enhance.PersistenceCapable;
import org.apache.openjpa.event.LifecycleEventManager;
import org.apache.openjpa.lib.conf.Configurable;
import org.apache.openjpa.lib.conf.Configuration;
@ -394,6 +394,8 @@ public class MetaDataRepository implements PCRegistry.RegisterClassListener, Con
}
private ClassMetaData getMetaDataInternal(Class<?> cls, ClassLoader envLoader, boolean mustExist) {
ClassMetaData meta = getMetaDataInternal(cls, envLoader);
if (meta == null) {
if (cls != null && DynamicPersistenceCapable.class.isAssignableFrom(cls))
cls = cls.getSuperclass();
@ -401,8 +403,8 @@ public class MetaDataRepository implements PCRegistry.RegisterClassListener, Con
// to locate metadata
if (cls != null && _implGen != null && _implGen.isImplType(cls))
cls = _implGen.toManagedInterface(cls);
ClassMetaData meta = getMetaDataInternal(cls, envLoader);
meta = getMetaDataInternal(cls, envLoader);
}
if (meta == null && mustExist) {
if (cls != null && !ImplHelper.isManagedType(_conf, cls))
throw new MetaDataException(_loc.get("no-meta-notpc", cls)).setFatal(false);