mirror of https://github.com/apache/openjpa.git
OPENJPA-1121: Load user-defined Enums.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@826959 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
afb95a595f
commit
59c81b98aa
|
@ -73,9 +73,15 @@ public class TemporaryClassLoader extends ClassLoader {
|
|||
// To avoid classloader issues with the JVM (Sun and IBM), we
|
||||
// will not load Enums via the TemporaryClassLoader either.
|
||||
// Reference JIRA Issue OPENJPA-646 for more information.
|
||||
if (isAnnotation(classBytes) || isEnum(classBytes))
|
||||
return Class.forName(name, resolve, getClass().
|
||||
getClassLoader());
|
||||
if (isAnnotation(classBytes) || isEnum(classBytes)) {
|
||||
try {
|
||||
Class<?> frameworkClass = Class.forName(name, resolve,
|
||||
getClass().getClassLoader());
|
||||
return frameworkClass;
|
||||
} catch (ClassNotFoundException e) {
|
||||
// continue, as it must be a user-defined class
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return defineClass(name, classBytes, 0, classBytes.length);
|
||||
|
|
Loading…
Reference in New Issue