]> source.dussan.org Git - aspectj.git/commitdiff
289816
authoraclement <aclement>
Fri, 18 Sep 2009 23:05:59 +0000 (23:05 +0000)
committeraclement <aclement>
Fri, 18 Sep 2009 23:05:59 +0000 (23:05 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java

index 4d6d73b337e2326d8776e1af1ee156d50f026f21..dade0bbe630e57af716d8658de4cd161ec789ce7 100644 (file)
@@ -390,18 +390,22 @@ public class BcelWorld extends World implements Repository {
                        }
                }
 
+               ClassPathManager.ClassFile file = null;
                try {
-                       ClassPathManager.ClassFile file = classPath.find(UnresolvedType.forName(name));
+                       file = classPath.find(UnresolvedType.forName(name));
                        if (file == null)
                                return null;
 
                        ClassParser parser = new ClassParser(file.getInputStream(), file.getPath());
 
                        JavaClass jc = parser.parse();
-                       file.close();
                        return jc;
                } catch (IOException ioe) {
                        return null;
+               } finally {
+                       if (file != null) {
+                               file.close();                   
+                       }
                }
        }