aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timothyjw...@apache.org
Subject svn commit: r1140216 - /aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
Date Mon, 27 Jun 2011 15:58:03 GMT
Author: timothyjward
Date: Mon Jun 27 15:58:03 2011
New Revision: 1140216

URL: http://svn.apache.org/viewvc?rev=1140216&view=rev
Log:
ARIES-690 : Avoid bug in JVM when calling Class#getEnclosingClass()

Modified:
    aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java

Modified: aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
URL: http://svn.apache.org/viewvc/aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java?rev=1140216&r1=1140215&r2=1140216&view=diff
==============================================================================
--- aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
(original)
+++ aries/trunk/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
Mon Jun 27 15:58:03 2011
@@ -614,19 +614,9 @@ public abstract class AbstractWovenProxy
    * @throws IOException
    */
   public static void readClass(Class<?> c, ClassVisitor adapter) throws IOException
{
-    String className;
-    Class<?> enclosing = c.getEnclosingClass();
-    List<Class<?>> enclosingChain = new ArrayList<Class<?>>();
-    while(enclosing != null) {
-      enclosingChain.add(enclosing);
-      enclosing = enclosing.getEnclosingClass();
-    }
-    StringBuilder sb = new StringBuilder();
-    for(Class<?> clazz : enclosingChain) {
-      sb.append(clazz.getSimpleName()).append('$');
-    }
-    className = sb.append(c.getSimpleName()).append(".class").toString();
-    
+    String className = c.getName();
+    className = className.substring(className.lastIndexOf('.') + 1) + ".class";
+        
     //Load the class bytes and copy methods across
     ClassReader cReader = new ClassReader(c.getResourceAsStream(className));
 



Mime
View raw message