mirror of https://github.com/apache/openjpa.git
Slight update for the changes introduced via svn revision 506230 (OPENJPA-138). Instead of just skipping the "null ClassLoader" (which indicates the SystemClassLoader), we'll use the static ClassLoader.getSystemClassLoader() method in order to populate the cache.
This change will help the non-container-managed environment (whereas the original change only benefitted the container-managed environment). This was discussed on the dev mailing list between Patrick, Marc, and myself. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@512357 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4bf637f074
commit
7303bcd5d5
|
@ -92,9 +92,10 @@ public class ObjectValue extends Value {
|
|||
ClassLoader cl = (ClassLoader) _classloaderCache.get(type);
|
||||
if (cl == null) {
|
||||
cl = type.getClassLoader();
|
||||
if (cl != null) { // System classloader is returned as null
|
||||
_classloaderCache.put(type, cl);
|
||||
if (cl == null) { // System classloader is returned as null
|
||||
cl = ClassLoader.getSystemClassLoader();
|
||||
}
|
||||
_classloaderCache.put(type, cl);
|
||||
}
|
||||
return Configurations.newInstance(clsName, this, conf, cl, fatal);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue