/** * Returns whether the given instruction may throw exceptions. */ public boolean mayThrowExceptions(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { mayThrowExceptions = false; instruction.accept(clazz, method, codeAttribute, offset, this); return mayThrowExceptions; }
public boolean hasSideEffects(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { hasSideEffects = false; instruction.accept(clazz, method, codeAttribute, offset, this); return hasSideEffects; }
public boolean hasSideEffects(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { hasSideEffects = false; instruction.accept(clazz, method, codeAttribute, offset, this); return hasSideEffects; }
public boolean hasSideEffects(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { hasSideEffects = false; instruction.accept(clazz, method, codeAttribute, offset, this); return hasSideEffects; }
public boolean hasSideEffects(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { hasSideEffects = false; instruction.accept(clazz, method, codeAttribute, offset, this); return hasSideEffects; }
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor) { if (instructionVisitor != CodeAttributeEditor.this) { throw new UnsupportedOperationException("Unexpected visitor ["+instructionVisitor+"]"); } for (int index = 0; index < instructions.length; index++) { Instruction instruction = instructions[index]; instruction.accept(clazz, method, codeAttribute, offset, CodeAttributeEditor.this); } }
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor) { if (instructionVisitor != CodeAttributeEditor.this) { throw new UnsupportedOperationException("Unexpected visitor ["+instructionVisitor+"]"); } for (int index = 0; index < instructions.length; index++) { Instruction instruction = instructions[index]; instruction.accept(clazz, method, codeAttribute, offset, CodeAttributeEditor.this); } }
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor) { if (instructionVisitor != CodeAttributeEditor.this) { throw new UnsupportedOperationException("Unexpected visitor ["+instructionVisitor+"]"); } for (int index = 0; index < instructions.length; index++) { Instruction instruction = instructions[index]; instruction.accept(clazz, method, codeAttribute, offset, CodeAttributeEditor.this); } }
/** * Applies the given instruction visitor to the instruction at the specified * offset. */ public void instructionAccept(Clazz clazz, Method method, int offset, InstructionVisitor instructionVisitor) { Instruction instruction = InstructionFactory.create(code, offset); instruction.accept(clazz, method, this, offset, instructionVisitor); }
/** * Applies the given instruction visitor to the instruction at the specified * offset. */ public void instructionAccept(Clazz clazz, Method method, int offset, InstructionVisitor instructionVisitor) { Instruction instruction = InstructionFactory.create(code, offset); instruction.accept(clazz, method, this, offset, instructionVisitor); }
/** * Applies the given instruction visitor to the instruction at the specified * offset. */ public void instructionAccept(Clazz clazz, Method method, int offset, InstructionVisitor instructionVisitor) { Instruction instruction = InstructionFactory.create(code, offset); instruction.accept(clazz, method, this, offset, instructionVisitor); }
/** * Applies the given instruction visitor to the instruction at the specified * offset. */ public void instructionAccept(Clazz clazz, Method method, int offset, InstructionVisitor instructionVisitor) { Instruction instruction = InstructionFactory.create(code, offset); instruction.accept(clazz, method, this, offset, instructionVisitor); }
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor) { if (instructionVisitor != CodeAttributeEditor.this) { throw new UnsupportedOperationException("Unexpected visitor ["+instructionVisitor+"]"); } for (int index = 0; index < instructions.length; index++) { Instruction instruction = instructions[index]; instruction.accept(clazz, method, codeAttribute, offset, CodeAttributeEditor.this); offset += instruction.length(offset); } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { codeAttributeEditor.deleteInstruction(offset); // We're allowing edits on deleted instructions. //codeAttributeEditor.insertBeforeInstruction(offset, (Instruction)null); //codeAttributeEditor.replaceInstruction(offset, (Instruction)null); //codeAttributeEditor.insertAfterInstruction(offset, (Instruction)null); // Visit the instruction, if required. if (extraDeletedInstructionVisitor != null) { instruction.accept(clazz, method, codeAttribute, offset, extraDeletedInstructionVisitor); } } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { codeAttributeEditor.deleteInstruction(offset); // We're allowing edits on deleted instructions. //codeAttributeEditor.insertBeforeInstruction(offset, (Instruction)null); //codeAttributeEditor.replaceInstruction(offset, (Instruction)null); //codeAttributeEditor.insertAfterInstruction(offset, (Instruction)null); // Visit the instruction, if required. if (extraDeletedInstructionVisitor != null) { instruction.accept(clazz, method, codeAttribute, offset, extraDeletedInstructionVisitor); } } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { codeAttributeEditor.deleteInstruction(offset); // We're allowing edits on deleted instructions. //codeAttributeEditor.insertBeforeInstruction(offset, (Instruction)null); //codeAttributeEditor.replaceInstruction(offset, (Instruction)null); //codeAttributeEditor.insertAfterInstruction(offset, (Instruction)null); // Visit the instruction, if required. if (extraDeletedInstructionVisitor != null) { instruction.accept(clazz, method, codeAttribute, offset, extraDeletedInstructionVisitor); } } }
/** * Creates the replacement instruction for the given index in the * instruction sequence. */ public Instruction create(int index) { // Create the instruction. replacementInstructions[index].accept(null, null, null, instructionSequenceMatcher.matchedInstructionOffset(index), this); // Return it. return replacementInstruction.shrink(); }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { instruction.accept(clazz, method, codeAttribute, offset, invokeMatcher); if (invokeMatcher.isMatching()) { MethodrefConstant methodrefConstant = (MethodrefConstant)((ProgramClass)clazz).getConstant(invokeMatcher.matchedArgument(FIELD_INDEX)); if (ClassConstants.METHOD_NAME_INIT.equals(methodrefConstant.getName(clazz))) { isSuperConstructorCalled |= methodrefConstant.getClassName(clazz).equals(clazz.getSuperName()); } } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { instruction.accept(clazz, method, codeAttribute, offset, invokeMatcher); if (invokeMatcher.isMatching()) { MethodrefConstant methodrefConstant = (MethodrefConstant)((ProgramClass)clazz).getConstant(invokeMatcher.matchedArgument(FIELD_INDEX)); if (ClassConstants.METHOD_NAME_INIT.equals(methodrefConstant.getName(clazz))) { isSuperConstructorCalled |= methodrefConstant.getClassName(clazz).equals(clazz.getSuperName()); } } }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { instruction.accept(clazz, method, codeAttribute, offset, invokeMatcher); if (invokeMatcher.isMatching()) { MethodrefConstant methodrefConstant = (MethodrefConstant)((ProgramClass)clazz).getConstant(invokeMatcher.matchedArgument(FIELD_INDEX)); if (ClassConstants.METHOD_NAME_INIT.equals(methodrefConstant.getName(clazz))) { isSuperConstructorCalled |= methodrefConstant.getClassName(clazz).equals(clazz.getSuperName()); } } }