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/25 18:10:15 UTC

svn commit: r1697716 - /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableInstruction.java

Author: sebb
Date: Tue Aug 25 16:10:15 2015
New Revision: 1697716

URL: http://svn.apache.org/r1697716
Log:
Need direct setter for n

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

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableInstruction.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableInstruction.java?rev=1697716&r1=1697715&r2=1697716&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableInstruction.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/LocalVariableInstruction.java Tue Aug 25 16:10:15 2015
@@ -153,7 +153,10 @@ public abstract class LocalVariableInstr
 
 
     /**
-     * Set the local variable index
+     * Set the local variable index.
+     * also updates opcode and length
+     * TODO Why?
+     * @see #setIndexOnly(int)
      */
     @Override
     public void setIndex( int n ) { // TODO could be package-protected?
@@ -213,4 +216,13 @@ public abstract class LocalVariableInstr
                 throw new ClassGenException("Oops: unknown case in switch" + canon_tag);
         }
     }
+
+    /**
+     * Sets the index of the referenced variable (n) only
+     * @since 6.0
+     * @see #setIndex(int)
+     */
+    final void setIndexOnly(int n) {
+        this.n = n;
+    }
 }