From: aclement Date: Mon, 8 Jun 2009 21:50:11 +0000 (+0000) Subject: 277616: renaming this to ajc$this on extract to static method X-Git-Tag: V1_6_5~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4a0eb9eea41c710a47a40f84048d289c17648407;p=aspectj.git 277616: renaming this to ajc$this on extract to static method --- diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/LocalVariableTag.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/LocalVariableTag.java index ffe857079..724f0cad8 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/LocalVariableTag.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/LocalVariableTag.java @@ -11,67 +11,84 @@ * Andy Clement pushed down into bcel module * ******************************************************************/ - package org.aspectj.apache.bcel.generic; public final class LocalVariableTag extends Tag { private Type type; // not always known, in which case signature has to be used - private final String signature; - private final String name; - private int slot; - private final int startPos; - boolean remapped = false; + private final String signature; + private String name; + private int slot; + private final int startPos; + boolean remapped = false; + + // AMC - pr101047, two local vars with the same name can share the same slot, but must in that case + // have different start positions. + public LocalVariableTag(String sig, String name, int slot, int startPosition) { + this.signature = sig; + this.name = name; + this.slot = slot; + this.startPos = startPosition; + } + + public LocalVariableTag(Type t, String sig, String name, int slot, int startPosition) { + this.type = t; + this.signature = sig; + this.name = name; + this.slot = slot; + this.startPos = startPosition; + } + + public String getName() { + return name; + } + + public int getSlot() { + return slot; + } + + public String getType() { + return signature; + } + + public Type getRealType() { + return type; + } + + public void updateSlot(int newSlot) { + this.slot = newSlot; + this.remapped = true; + } + + public boolean isRemapped() { + return this.remapped; + } + + public String toString() { + return "local " + slot + ": " + signature + " " + name; + } - // AMC - pr101047, two local vars with the same name can share the same slot, but must in that case - // have different start positions. - public LocalVariableTag(String sig, String name, int slot, int startPosition) { - this.signature = sig; - this.name = name; - this.slot = slot; - this.startPos = startPosition; - } - - public LocalVariableTag(Type t,String sig, String name, int slot, int startPosition) { - this.type = t; - this.signature = sig; - this.name = name; - this.slot = slot; - this.startPos = startPosition; - } + public boolean equals(Object other) { + if (!(other instanceof LocalVariableTag)) + return false; + LocalVariableTag o = (LocalVariableTag) other; + return o.slot == slot && o.startPos == startPos && o.signature.equals(signature) && o.name.equals(name); + } + public void setName(String name) { + this.name = name; + } - public String getName() {return name;} - public int getSlot() {return slot;} - public String getType() {return signature;} - public Type getRealType() {return type;} - - public void updateSlot(int newSlot) { - this.slot = newSlot; - this.remapped = true; - } - - public boolean isRemapped() { return this.remapped; } - - public String toString() { - return "local " + slot + ": " + signature + " " + name; - } + private int hashCode = 0; - public boolean equals(Object other) { - if (!(other instanceof LocalVariableTag)) return false; - LocalVariableTag o = (LocalVariableTag)other; - return o.slot == slot && o.startPos == startPos && o.signature.equals(signature) && o.name.equals(name); - } - - private int hashCode = 0; - public int hashCode() { - if (hashCode == 0) { - int ret = 17; - ret = 37*ret + signature.hashCode(); - ret = 37*ret + name.hashCode(); - ret = 37*ret + slot; - ret = 37*ret + startPos; - hashCode = ret; - } - return hashCode; - } + public int hashCode() { + if (hashCode == 0) { + int ret = 17; + ret = 37 * ret + signature.hashCode(); + ret = 37 * ret + name.hashCode(); + ret = 37 * ret + slot; + ret = 37 * ret + startPos; + hashCode = ret; + } + return hashCode; + } }