Methods Summary |
---|
public void | add(java.lang.String name, int startpc, int length, com.sun.org.apache.bcel.internal.generic.Type t)Adds some information about this local variable (slot).
for (int i=startpc; i<=startpc+length; i++){ // incl/incl-notation!
add(i,name,t);
}
|
private void | add(int offset, java.lang.String name, com.sun.org.apache.bcel.internal.generic.Type t)Adds information about name and type for a given offset.
if (getName(offset) != null){
if (! getName(offset).equals(name)){
throw new LocalVariableInfoInconsistentException("At bytecode offset '"+offset+"' a local variable has two different names: '"+getName(offset)+"' and '"+name+"'.");
}
}
if (getType(offset) != null){
if (! getType(offset).equals(t)){
throw new LocalVariableInfoInconsistentException("At bytecode offset '"+offset+"' a local variable has two different types: '"+getType(offset)+"' and '"+t+"'.");
}
}
setName(offset, name);
setType(offset, t);
|
public java.lang.String | getName(int offset)Returns the name of the local variable that uses this local
variable slot at the given bytecode offset.
Care for legal bytecode offsets yourself, otherwise the return value
might be wrong.
May return 'null' if nothing is known about the type of this local
variable slot at the given bytecode offset.
return (String) (names.get(Integer.toString(offset)));
|
public com.sun.org.apache.bcel.internal.generic.Type | getType(int offset)Returns the type of the local variable that uses this local
variable slot at the given bytecode offset.
Care for legal bytecode offsets yourself, otherwise the return value
might be wrong.
May return 'null' if nothing is known about the type of this local
variable slot at the given bytecode offset.
return (Type) types.get(Integer.toString(offset));
|
private void | setName(int offset, java.lang.String name)Adds a name of a local variable and a certain slot to our 'names'
(Hashtable) database.
names.put( ((Integer.toString(offset))), name);
|
private void | setType(int offset, com.sun.org.apache.bcel.internal.generic.Type t)Adds a type of a local variable and a certain slot to our 'types'
(Hashtable) database.
types.put( ((Integer.toString(offset))), t);
|