/** * Two local variable instructions are equal if the local index they * reference is equal or if either index is 0/unset. */ public boolean equalsInstruction(Instruction other) { if (this == other) return true; if (!getClass().equals(other.getClass())) return false; LocalVariableInstruction ins = (LocalVariableInstruction) other; int index = getLocal(); int insIndex = ins.getLocal(); return index == -1 || insIndex == -1 || index == insIndex; }
/** * Two local variable instructions are equal if the local index they * reference is equal or if either index is 0/unset. */ public boolean equalsInstruction(Instruction other) { if (this == other) return true; if (!getClass().equals(other.getClass())) return false; LocalVariableInstruction ins = (LocalVariableInstruction) other; int index = getLocal(); int insIndex = ins.getLocal(); return index == -1 || insIndex == -1 || index == insIndex; }
/** * Return the parameter that this instruction operates on, or -1 if none. */ public int getParam() { return getCode().getParamsIndex(getLocal()); }
/** * Return the parameter that this instruction operates on, or -1 if none. */ public int getParam() { return getCode().getParamsIndex(getLocal()); }
void read(Instruction orig) { super.read(orig); setLocal(((LocalVariableInstruction) orig).getLocal()); }
void read(Instruction orig) { super.read(orig); setLocal(((LocalVariableInstruction) orig).getLocal()); }
/** * 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()); }
/** * 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()); }