diff options
author | alesj <alesj@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2010-04-21 14:19:44 +0000 |
---|---|---|
committer | alesj <alesj@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2010-04-21 14:19:44 +0000 |
commit | e7392c68c6ae1f087047a6b51fe3a2ad6532c41a (patch) | |
tree | 6866feef9092feef0bd629e451c5ccf07243f510 | |
parent | 06eed61bab16188b6ec1617136d708ee7236c22d (diff) | |
download | javassist-e7392c68c6ae1f087047a6b51fe3a2ad6532c41a.tar.gz javassist-e7392c68c6ae1f087047a6b51fe3a2ad6532c41a.zip |
[JASSIST-115]; use try/finally for toClass2.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@535 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
-rw-r--r-- | src/main/javassist/ClassPool.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/javassist/ClassPool.java b/src/main/javassist/ClassPool.java index fd099794..13f8b71b 100644 --- a/src/main/javassist/ClassPool.java +++ b/src/main/javassist/ClassPool.java @@ -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); + } } } |