SLING-2447 : ClassLoaderWriter should provide class loader for loading written classes/resources
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1305390 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoader.java b/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoader.java
index cc7b29a..2eb5125 100644
--- a/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoader.java
+++ b/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoader.java
@@ -195,7 +195,8 @@
logger.debug("findResource: Try to find resource {}", name);
- final Node res = findClassLoaderResource(name);
+ final String path = this.repositoryPath + '/' + name;
+ final Node res = findClassLoaderResource(path);
if (res != null) {
logger.debug("findResource: Getting resource from {}",
res);
@@ -263,7 +264,8 @@
logger.debug("findClassPrivileged: Try to find path {class {}",
name);
- final Node res = this.findClassLoaderResource(name);
+ final String path = this.repositoryPath + '/' + name.replace('.', '/') + (".class");
+ final Node res = this.findClassLoaderResource(path);
if (res != null) {
// try defining the class, error aborts
@@ -308,8 +310,7 @@
* @throws NullPointerException If this class loader has already been
* destroyed.
*/
- private Node findClassLoaderResource(final String name) {
- final String path = this.repositoryPath + '/' + name.replace('.', '/') + (".class");
+ private Node findClassLoaderResource(final String path) {
Node res = null;
try {
if ( session.itemExists(path) ) {