]> source.dussan.org Git - javassist.git/commitdiff
[JASSIST-115]; use try/finally for toClass2.
authoralesj <alesj@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Wed, 21 Apr 2010 14:19:44 +0000 (14:19 +0000)
committeralesj <alesj@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Wed, 21 Apr 2010 14:19:44 +0000 (14:19 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@535 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/ClassPool.java

index fd099794679369b4aab11a1cd76c13a837a08396..13f8b71bdab97debcfe024b8b23fc62f89ce6b52 100644 (file)
@@ -1060,8 +1060,11 @@ public class ClassPool {
         throws Exception
     {
         method.setAccessible(true);
-        Class clazz = (Class)method.invoke(loader, args);
-        method.setAccessible(false);
-        return clazz;
+        try {
+            return (Class)method.invoke(loader, args);
+        }
+        finally {
+            method.setAccessible(false);
+        }
     }
 }