You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/26 15:13:33 UTC

svn commit: r1697925 - /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java

Author: sebb
Date: Wed Aug 26 13:13:33 2015
New Revision: 1697925

URL: http://svn.apache.org/r1697925
Log:
Follow-up to BCEL-209 Drop the field num_bootstrap_arguments
it is not necessary, and was not kept in sync if the arguments were updated
Oops - incomplete fix, now working

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java?rev=1697925&r1=1697924&r2=1697925&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java Wed Aug 26 13:13:33 2015
@@ -46,7 +46,7 @@ public class BootstrapMethod implements
      * Initialize from another object.
      */
     public BootstrapMethod(BootstrapMethod c) {
-        this(c.getBootstrapMethodRef(), c.getNumBootstrapArguments(), c.getBootstrapArguments());
+        this(c.getBootstrapMethodRef(), c.getBootstrapArguments());
     }
 
     /**
@@ -56,22 +56,24 @@ public class BootstrapMethod implements
      * @throws IOException
      */
     BootstrapMethod(DataInput input) throws IOException {
-        this(input.readUnsignedShort(), input.readUnsignedShort(), (int[]) null);
+        this(input.readUnsignedShort(), input.readUnsignedShort());
 
         for (int i = 0; i < bootstrap_arguments.length; i++) {
             bootstrap_arguments[i] = input.readUnsignedShort();
         }
     }
 
+    // helper method
+    private BootstrapMethod(int bootstrap_method_ref, int num_bootstrap_arguments) {
+        this(bootstrap_method_ref, new int[num_bootstrap_arguments]);
+    }
 
     /**
      * @param bootstrap_method_ref int index into constant_pool of CONSTANT_MethodHandle
-     * @param num_bootstrap_arguments int count of number of boostrap arguments
      * @param bootstrap_arguments int[] indices into constant_pool of CONSTANT_<type>_info
      */
-    public BootstrapMethod(int bootstrap_method_ref, int num_bootstrap_arguments, int[] bootstrap_arguments) {
+    public BootstrapMethod(int bootstrap_method_ref, int[] bootstrap_arguments) {
         this.bootstrap_method_ref = bootstrap_method_ref;
-        this.bootstrap_arguments = new int[num_bootstrap_arguments];
         this.bootstrap_arguments = bootstrap_arguments;
     }