Author: dbrosius
Date: Tue Apr  1 20:38:41 2008
New Revision: 643697

URL: http://svn.apache.org/viewvc?rev=643697&view=rev
Log:
don't throw exceptions on close from a finally block

Modified:
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java

Modified: 
jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java
URL: 
http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java?rev=643697&r1=643696&r2=643697&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java 
(original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java 
Tue Apr  1 20:38:41 2008
@@ -23,6 +23,7 @@
 import java.io.InputStream;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
+
 import org.apache.bcel.Constants;
 
 /**
@@ -162,12 +163,16 @@
         } finally {
             // Read everything of interest, so close the file
             if (fileOwned) {
-                if (file != null) {
-                    file.close();
-                }
-                if (zip != null) {
-                    zip.close();
-                }
+               try {
+                       if (file != null) {
+                           file.close();
+                       }
+                       if (zip != null) {
+                           zip.close();
+                       }
+               } catch (IOException ioe) {
+                       //ignore close exceptions
+               }
             }
         }
         // Return the information we have gathered in a new object



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to