From e7392c68c6ae1f087047a6b51fe3a2ad6532c41a Mon Sep 17 00:00:00 2001 From: alesj Date: Wed, 21 Apr 2010 14:19:44 +0000 Subject: [PATCH] [JASSIST-115]; use try/finally for toClass2. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@535 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/ClassPool.java | 9 ++++++--- 1 file 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); + } } } -- 2.39.5