This is an automated email from the ASF dual-hosted git repository.
pauls pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-classloader.git
The following commit(s) were added to refs/heads/master by this push:
new 5a8e153 SLING-7319: Bootdelegate sun.reflect. and
jdk.internal.reflect. to prevent NCDF on reflection when not bootdelegated by
the framework.
5a8e153 is described below
commit 5a8e15390770a158ed310a600b965233af80b85f
Author: Karl Pauls <[email protected]>
AuthorDate: Tue Dec 19 17:55:47 2017 +0100
SLING-7319: Bootdelegate sun.reflect. and jdk.internal.reflect. to prevent
NCDF on reflection when not bootdelegated by the framework.
---
.../apache/sling/commons/classloader/impl/ClassLoaderFacade.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git
a/src/main/java/org/apache/sling/commons/classloader/impl/ClassLoaderFacade.java
b/src/main/java/org/apache/sling/commons/classloader/impl/ClassLoaderFacade.java
index f60a34b..c43b53f 100644
---
a/src/main/java/org/apache/sling/commons/classloader/impl/ClassLoaderFacade.java
+++
b/src/main/java/org/apache/sling/commons/classloader/impl/ClassLoaderFacade.java
@@ -146,6 +146,15 @@ public class ClassLoaderFacade extends ClassLoader
implements DynamicClassLoader
}
}
}
+ if (name.startsWith("sun.reflect.") ||
name.startsWith("jdk.internal.reflect.")) {
+ try {
+ return ClassLoader.getSystemClassLoader().loadClass(name);
+ } catch (ClassNotFoundException cnfe) {
+ // we just ignore this and throw our own exception
+ } catch (Throwable t) {
+ logger.error("Exception while trying to load class " + name +
" from class loader " + ClassLoader.getSystemClassLoader(), t);
+ }
+ }
throw new ClassNotFoundException(name);
}
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].