You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ch...@apache.org on 2015/08/13 03:36:31 UTC
svn commit: r1695642 - in
/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile:
LocalVariableTable.java Utility.java
Author: chas
Date: Thu Aug 13 01:36:31 2015
New Revision: 1695642
URL: http://svn.apache.org/r1695642
Log:
BCEL-231
Remove deprecated methods and classes
Modified:
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java?rev=1695642&r1=1695641&r2=1695642&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java Thu Aug 13 01:36:31 2015
@@ -118,26 +118,6 @@ public class LocalVariableTable extends
/**
*
* @param index the variable slot
- *
- * @return the first LocalVariable that matches the slot or null if not found
- *
- * @deprecated since 5.2 because multiple variables can share the
- * same slot, use getLocalVariable(int index, int pc) instead.
- */
- @java.lang.Deprecated
- public final LocalVariable getLocalVariable( int index ) {
- for (LocalVariable variable : local_variable_table) {
- if (variable.getIndex() == index) {
- return variable;
- }
- }
- return null;
- }
-
-
- /**
- *
- * @param index the variable slot
* @param pc the current pc that this variable is alive
*
* @return the LocalVariable that matches or null if not found
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java?rev=1695642&r1=1695641&r2=1695642&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java Thu Aug 13 01:36:31 2015
@@ -691,7 +691,7 @@ public abstract class Utility {
String param_type = signatureToString(signature.substring(index), chopit);
buf.append(param_type);
if (vars != null) {
- LocalVariable l = vars.getLocalVariable(var_index);
+ LocalVariable l = vars.getLocalVariable(var_index, 0);
if (l != null) {
buf.append(" ").append(l.getName());
}
Re: svn commit: r1695642 - in /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile:
LocalVariableTable.java Utility.java
Posted by sebb <se...@gmail.com>.
On 13 August 2015 at 02:36, <ch...@apache.org> wrote:
> Author: chas
> Date: Thu Aug 13 01:36:31 2015
> New Revision: 1695642
>
> URL: http://svn.apache.org/r1695642
> Log:
> BCEL-231
> Remove deprecated methods and classes
>
> Modified:
> commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java
> commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java
>
> Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java
> URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java?rev=1695642&r1=1695641&r2=1695642&view=diff
> ==============================================================================
> --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java (original)
> +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java Thu Aug 13 01:36:31 2015
> @@ -118,26 +118,6 @@ public class LocalVariableTable extends
> /**
> *
> * @param index the variable slot
> - *
> - * @return the first LocalVariable that matches the slot or null if not found
> - *
> - * @deprecated since 5.2 because multiple variables can share the
> - * same slot, use getLocalVariable(int index, int pc) instead.
> - */
> - @java.lang.Deprecated
> - public final LocalVariable getLocalVariable( int index ) {
> - for (LocalVariable variable : local_variable_table) {
> - if (variable.getIndex() == index) {
> - return variable;
> - }
> - }
> - return null;
> - }
> -
> -
> - /**
> - *
> - * @param index the variable slot
> * @param pc the current pc that this variable is alive
> *
> * @return the LocalVariable that matches or null if not found
>
> Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java
> URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java?rev=1695642&r1=1695641&r2=1695642&view=diff
> ==============================================================================
> --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java (original)
> +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Utility.java Thu Aug 13 01:36:31 2015
> @@ -691,7 +691,7 @@ public abstract class Utility {
> String param_type = signatureToString(signature.substring(index), chopit);
> buf.append(param_type);
> if (vars != null) {
> - LocalVariable l = vars.getLocalVariable(var_index);
> + LocalVariable l = vars.getLocalVariable(var_index, 0);
Are you sure that will work?
I could not find a test that exercises this code, and could not work
out how the PC value would be calculated.
> if (l != null) {
> buf.append(" ").append(l.getName());
> }
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org