--- old/jaxp/src/com/sun/org/apache/bcel/internal/generic/LocalVariableGen.java 2013-05-13 16:29:17.000000000 +0200 +++ new/jaxp/src/com/sun/org/apache/bcel/internal/generic/LocalVariableGen.java 2013-05-13 16:29:16.000000000 +0200 @@ -60,6 +60,7 @@ import com.sun.org.apache.bcel.internal.Constants; import com.sun.org.apache.bcel.internal.classfile.*; +import java.util.Objects; /** * This class represents a local variable within a method. It contains its @@ -131,11 +132,15 @@ signature_index, index, cp.getConstantPool()); } - public void setIndex(int index) { this.index = index; } - public int getIndex() { return index; } + public void setIndex(int index) { this.index = index; } + public int getIndex() { return index; } + @Override public void setName(String name) { this.name = name; } + @Override public String getName() { return name; } + @Override public void setType(Type type) { this.type = type; } + @Override public Type getType() { return type; } public InstructionHandle getStart() { return start; } @@ -155,6 +160,7 @@ * @param old_ih old target, either start or end * @param new_ih new target */ + @Override public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) { boolean targeted = false; @@ -176,6 +182,7 @@ /** * @return true, if ih is target of this variable */ + @Override public boolean containsTarget(InstructionHandle ih) { return (start == ih) || (end == ih); } @@ -184,6 +191,7 @@ * We consider to local variables to be equal, if the use the same index and * are valid in the same range. */ + @Override public boolean equals(Object o) { if(!(o instanceof LocalVariableGen)) return false; @@ -192,10 +200,21 @@ return (l.index == index) && (l.start == start) && (l.end == end); } + @Override + public int hashCode() { + int hash = 7; + hash = 59 * hash + this.index; + hash = 59 * hash + Objects.hashCode(this.start); + hash = 59 * hash + Objects.hashCode(this.end); + return hash; + } + + @Override public String toString() { return "LocalVariableGen(" + name + ", " + type + ", " + start + ", " + end + ")"; } + @Override public Object clone() { try { return super.clone();