mirror of
https://github.com/apache/openjpa.git
synced 2025-03-03 15:09:14 +00:00
Guard for null in Class.getClassLoader().
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@497635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e2665ce5dd
commit
4a5e42ff8b
@ -656,9 +656,14 @@ public class AnnotationPersistenceMetaDataParser
|
|||||||
cls = cls.getEnclosingClass();
|
cls = cls.getEnclosingClass();
|
||||||
|
|
||||||
String rsrc = StringUtils.replace(cls.getName(), ".", "/");
|
String rsrc = StringUtils.replace(cls.getName(), ".", "/");
|
||||||
URL url = cls.getClassLoader().getResource(rsrc + ".java");
|
ClassLoader loader = cls.getClassLoader();
|
||||||
|
if (loader == null)
|
||||||
|
loader = ClassLoader.getSystemClassLoader();
|
||||||
|
if (loader == null)
|
||||||
|
return null;
|
||||||
|
URL url = loader.getResource(rsrc + ".java");
|
||||||
if (url == null) {
|
if (url == null) {
|
||||||
url = cls.getClassLoader().getResource(rsrc + ".class");
|
url = loader.getResource(rsrc + ".class");
|
||||||
if (url == null)
|
if (url == null)
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user