[jboss-cvs] JBossAS SVN: r75874 - projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 16 03:34:07 EDT 2008


Author: alesj
Date: 2008-07-16 03:34:07 -0400 (Wed, 16 Jul 2008)
New Revision: 75874

Modified:
   projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations/GenericAnnotationResourceVisitor.java
Log:
Close input stream.

Modified: projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations/GenericAnnotationResourceVisitor.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations/GenericAnnotationResourceVisitor.java	2008-07-16 07:30:15 UTC (rev 75873)
+++ projects/jboss-deployers/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/annotations/GenericAnnotationResourceVisitor.java	2008-07-16 07:34:07 UTC (rev 75874)
@@ -23,6 +23,8 @@
 
 import java.lang.annotation.Annotation;
 import java.lang.annotation.ElementType;
+import java.io.InputStream;
+import java.io.IOException;
 
 import javassist.ClassPool;
 import javassist.CtBehavior;
@@ -82,14 +84,28 @@
    {
       try
       {
-         CtClass ctClass = pool.makeClass(resource.getInputStream());
+         InputStream stream = resource.getInputStream();
          try
          {
-            handleCtClass(ctClass, resource);
+            CtClass ctClass = pool.makeClass(stream);
+            try
+            {
+               handleCtClass(ctClass, resource);
+            }
+            finally
+            {
+               ctClass.detach();
+            }
          }
          finally
          {
-            ctClass.detach();               
+            try
+            {
+               stream.close();
+            }
+            catch (IOException ignored)
+            {
+            }
          }
       }
       catch (ClassNotFoundException e)




More information about the jboss-cvs-commits mailing list