Author: sebb Date: Tue Jun 7 22:22:32 2016 New Revision: 1747323 URL: http://svn.apache.org/viewvc?rev=1747323&view=rev Log: Findbugs fixes courtesy of Andrey Loskutov This closes #4
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java?rev=1747323&r1=1747322&r2=1747323&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java Tue Jun 7 22:22:32 2016 @@ -174,13 +174,17 @@ public final class ClassParser { if (dataInputStream != null) { dataInputStream.close(); } - if (zip != null) { - zip.close(); - } } catch (IOException ioe) { //ignore close exceptions } } + try { + if (zip != null) { + zip.close(); + } + } catch (IOException ioe) { + //ignore close exceptions + } } // Return the information we have gathered in a new object return new JavaClass(class_name_index, superclass_name_index, file_name, major, minor, Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java?rev=1747323&r1=1747322&r2=1747323&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java Tue Jun 7 22:22:32 2016 @@ -442,8 +442,7 @@ public abstract class Utility { buf.append(bytes.readInt()); break; default: // Never reached - System.err.println("Unreachable default case reached!"); - System.exit(-1); + throw new IllegalStateException("Unreachable default case reached!"); } } }