[jboss-cvs] javassist/src/main/javassist ...
Shigeru Chiba
chiba at is.titech.ac.jp
Tue Oct 31 21:45:05 EST 2006
User: chiba
Date: 06/10/31 21:45:05
Modified: src/main/javassist ClassPool.java
Log:
fixed JIRA JASSIST-28?
Revision Changes Path
1.58 +13 -5 javassist/src/main/javassist/ClassPool.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ClassPool.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/ClassPool.java,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- ClassPool.java 16 Aug 2006 10:38:17 -0000 1.57
+++ ClassPool.java 1 Nov 2006 02:45:05 -0000 1.58
@@ -20,6 +20,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.lang.reflect.Method;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedActionException;
@@ -894,10 +895,7 @@
new Integer(b.length), domain};
}
- method.setAccessible(true);
- Class clazz = (Class)method.invoke(loader, args);
- method.setAccessible(false);
- return clazz;
+ return toClass2(method, loader, args);
}
catch (RuntimeException e) {
throw e;
@@ -909,4 +907,14 @@
throw new CannotCompileException(e);
}
}
+
+ private static synchronized Class toClass2(Method method,
+ ClassLoader loader, Object[] args)
+ throws Exception
+ {
+ method.setAccessible(true);
+ Class clazz = (Class)method.invoke(loader, args);
+ method.setAccessible(false);
+ return clazz;
+ }
}
More information about the jboss-cvs-commits
mailing list