geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r606536 - /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
Date Sun, 23 Dec 2007 04:27:16 GMT
Author: dblevins
Date: Sat Dec 22 20:27:15 2007
New Revision: 606536

URL: http://svn.apache.org/viewvc?rev=606536&view=rev
Log:
Close streams

Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java?rev=606536&r1=606535&r2=606536&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
Sat Dec 22 20:27:15 2007
@@ -684,8 +684,13 @@
         try {
             URL resource = classLoader.getResource(className);
             if (resource != null) {
-                ClassReader classReader = new ClassReader(resource.openStream());
-                classReader.accept(new InfoBuildingVisitor(), true);
+                InputStream in = resource.openStream();
+                try {
+                    ClassReader classReader = new ClassReader(in);
+                    classReader.accept(new InfoBuildingVisitor(), true);
+                } finally {
+                    in.close();
+                }
             } else {
                 new Exception("Could not load " + className).printStackTrace();
             }



Mime
View raw message