commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1696804 - /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/MethodGen.java
Date Thu, 20 Aug 2015 15:04:31 GMT
Author: sebb
Date: Thu Aug 20 15:04:30 2015
New Revision: 1696804

URL: http://svn.apache.org/r1696804
Log:
Impossible exceptions

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/MethodGen.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/MethodGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/MethodGen.java?rev=1696804&r1=1696803&r2=1696804&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/MethodGen.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/MethodGen.java
Thu Aug 20 15:04:30 2015
@@ -423,12 +423,9 @@ public class MethodGen extends FieldGenO
     public LineNumberTable getLineNumberTable( ConstantPoolGen cp ) {
         int size = line_number_vec.size();
         LineNumber[] ln = new LineNumber[size];
-        try {
-            for (int i = 0; i < size; i++) {
-                ln[i] = line_number_vec.get(i).getLineNumber();
-            }
-        } catch (ArrayIndexOutOfBoundsException e) {
-        } // Never occurs
+        for (int i = 0; i < size; i++) {
+            ln[i] = line_number_vec.get(i).getLineNumber();
+        }
         return new LineNumberTable(cp.addUtf8("LineNumberTable"), 2 + ln.length * 4, ln,
cp
                 .getConstantPool());
     }
@@ -488,12 +485,9 @@ public class MethodGen extends FieldGenO
     private CodeException[] getCodeExceptions() {
         int size = exception_vec.size();
         CodeException[] c_exc = new CodeException[size];
-        try {
-            for (int i = 0; i < size; i++) {
-                CodeExceptionGen c =  exception_vec.get(i);
-                c_exc[i] = c.getCodeException(cp);
-            }
-        } catch (ArrayIndexOutOfBoundsException e) {
+        for (int i = 0; i < size; i++) {
+            CodeExceptionGen c =  exception_vec.get(i);
+            c_exc[i] = c.getCodeException(cp);
         }
         return c_exc;
     }
@@ -541,11 +535,8 @@ public class MethodGen extends FieldGenO
     private ExceptionTable getExceptionTable( ConstantPoolGen cp ) {
         int size = throws_vec.size();
         int[] ex = new int[size];
-        try {
-            for (int i = 0; i < size; i++) {
-                ex[i] = cp.addClass(throws_vec.get(i));
-            }
-        } catch (ArrayIndexOutOfBoundsException e) {
+        for (int i = 0; i < size; i++) {
+            ex[i] = cp.addClass(throws_vec.get(i));
         }
         return new ExceptionTable(cp.addUtf8("Exceptions"), 2 + 2 * size, ex, cp.getConstantPool());
     }



Mime
View raw message