/** * Add a local to this table. */ public LocalVariable addLocalVariable(String name, String type) { return (LocalVariable) addLocal(name, type); }
/** * Add a local to this table. */ public LocalVariable addLocalVariable(String name, Class type) { String typeName = (type == null) ? null : type.getName(); return addLocalVariable(name, typeName); }
/** * Return the local with the given name, or null if none. If multiple * locals have the given name, which is returned is undefined. */ public LocalVariable getLocalVariable(String name) { return (LocalVariable) getLocal(name); }
/** * Return all locals with the given name, or empty array if none. */ public LocalVariable[] getLocalVariables(String name) { return (LocalVariable[]) getLocals(name); }
void read(DataInput in, int length) throws IOException { _maxStack = in.readUnsignedShort(); _maxLocals = in.readUnsignedShort(); readCode(in, in.readInt()); _handlers.clear(); int exceptionCount = in.readUnsignedShort(); ExceptionHandler excep; for (int i = 0; i < exceptionCount; i++) { excep = addExceptionHandler(); excep.read(in); excep.updateTargets(); } readAttributes(in); // setup local variable markers LocalVariableTable locals = getLocalVariableTable(false); if (locals != null) locals.updateTargets(); // setup local variable markers LocalVariableTypeTable localTypes = getLocalVariableTypeTable(false); if (localTypes != null) localTypes.updateTargets(); // setup line number markers LineNumberTable lines = getLineNumberTable(false); if (lines != null) lines.updateTargets(); }
/** * Return the local variable object this instruction * operates on, or null if none. * * @see LocalVariableTable#getLocalVariable(int) */ public LocalVariable getLocalVariable() { LocalVariableTable table = getCode().getLocalVariableTable(false); if (table == null) return null; return table.getLocalVariable(getLocal()); }
private void replaceTarget(Instruction orig, Instruction replace) { for (CodeEntry entry = _head.next; entry != _tail; entry = entry.next) { if (entry instanceof InstructionPtr) ((InstructionPtr) entry).replaceTarget(orig, replace); } // update the ExceptionHandler pointers ExceptionHandler[] handlers = getExceptionHandlers(); for (int i = 0; i < handlers.length; i++) handlers[i].replaceTarget(orig, replace); // update LineNumber pointers LineNumberTable lineNumbers = getLineNumberTable(false); if (lineNumbers != null) lineNumbers.replaceTarget(orig, replace); // update LocalVariable pointers LocalVariableTable variables = getLocalVariableTable(false); if (variables != null) variables.replaceTarget(orig, replace); // update LocalVariableType pointers LocalVariableTypeTable types = getLocalVariableTypeTable(false); if (types != null) types.replaceTarget(orig, replace); } }
/** * Return all the locals of this method. */ public LocalVariable[] getLocalVariables() { return (LocalVariable[]) getLocals(); }
void read(DataInput in, int length) throws IOException { _maxStack = in.readUnsignedShort(); _maxLocals = in.readUnsignedShort(); readCode(in, in.readInt()); _handlers.clear(); int exceptionCount = in.readUnsignedShort(); ExceptionHandler excep; for (int i = 0; i < exceptionCount; i++) { excep = addExceptionHandler(); excep.read(in); excep.updateTargets(); } readAttributes(in); // setup local variable markers LocalVariableTable locals = getLocalVariableTable(false); if (locals != null) locals.updateTargets(); // setup local variable markers LocalVariableTypeTable localTypes = getLocalVariableTypeTable(false); if (localTypes != null) localTypes.updateTargets(); // setup line number markers LineNumberTable lines = getLineNumberTable(false); if (lines != null) lines.updateTargets(); }
/** * Return the local variable object this instruction * operates on, or null if none. * * @see LocalVariableTable#getLocalVariable(int) */ public LocalVariable getLocalVariable() { LocalVariableTable table = getCode().getLocalVariableTable(false); if (table == null) return null; return table.getLocalVariable(getLocal()); }
private void replaceTarget(Instruction orig, Instruction replace) { for (CodeEntry entry = _head.next; entry != _tail; entry = entry.next) { if (entry instanceof InstructionPtr) ((InstructionPtr) entry).replaceTarget(orig, replace); } // update the ExceptionHandler pointers ExceptionHandler[] handlers = getExceptionHandlers(); for (int i = 0; i < handlers.length; i++) handlers[i].replaceTarget(orig, replace); // update LineNumber pointers LineNumberTable lineNumbers = getLineNumberTable(false); if (lineNumbers != null) lineNumbers.replaceTarget(orig, replace); // update LocalVariable pointers LocalVariableTable variables = getLocalVariableTable(false); if (variables != null) variables.replaceTarget(orig, replace); // update LocalVariableType pointers LocalVariableTypeTable types = getLocalVariableTypeTable(false); if (types != null) types.replaceTarget(orig, replace); } }
/** * Return all the locals of this method. */ public LocalVariable[] getLocalVariables() { return (LocalVariable[]) getLocals(); }
/** * Add a local to this table. */ public LocalVariable addLocalVariable() { return (LocalVariable) addLocal(); }
/** * Add a local to this table. */ public LocalVariable addLocalVariable(String name, Class type) { String typeName = (type == null) ? null : type.getName(); return addLocalVariable(name, typeName); }
/** * Return the local with the given locals index, or null if none. */ public LocalVariable getLocalVariable(int local) { return (LocalVariable) getLocal(local); }
/** * Return all locals with the given name, or empty array if none. */ public LocalVariable[] getLocalVariables(String name) { return (LocalVariable[]) getLocals(name); }
/** * Add a local to this table. */ public LocalVariable addLocalVariable(String name, String type) { return (LocalVariable) addLocal(name, type); }
/** * Add a local to this table. */ public LocalVariable addLocalVariable(String name, BCClass type) { String typeName = (type == null) ? null : type.getName(); return addLocalVariable(name, typeName); }
/** * Return the local with the given name, or null if none. If multiple * locals have the given name, which is returned is undefined. */ public LocalVariable getLocalVariable(String name) { return (LocalVariable) getLocal(name); }