Slight modification to only call Class.forName() when an array
type is detected to avoid class circularity error. (FELIX-1233)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@784796 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java b/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
index c5900d7..e815250 100644
--- a/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
@@ -537,10 +537,14 @@
public Class getClassByDelegation(String name) throws ClassNotFoundException
{
- // We do not call getClassLoader().loadClass() because this does not
- // correctly handle array types, which is necessary in cases like
- // deserialization using a wrapper class loader.
- return Class.forName(name, false, getClassLoader());
+ // We do not call getClassLoader().loadClass() for arrays because
+ // it does not correctly handle array types, which is necessary in
+ // cases like deserialization using a wrapper class loader.
+ if (name.charAt(0) == '[')
+ {
+ return Class.forName(name, false, getClassLoader());
+ }
+ return getClassLoader().loadClass(name);
}
public URL getResourceByDelegation(String name)