System.out.println(" " + ins.toString(cpg.getConstantPool()));
/** * @return mnemonic for instruction */ @Override public String toString( final boolean verbose ) { return super.toString(verbose) + " " + index; }
/** * @return mnemonic for instruction */ public String toString(boolean verbose) { return super.toString(verbose) + " " + org.apache.bcel.Constants.TYPE_NAMES[type]; } /**
/** * @return mnemonic for instruction */ public String toString(boolean verbose) { return super.toString(verbose) + " " + index; }
/** * @return mnemonic for instruction in verbose format */ @Override public String toString() { return toString(true); }
/** * @return mnemonic for instruction */ @Override public String toString( final boolean verbose ) { return super.toString(verbose) + " " + b; }
/** * @return mnemonic for instruction */ public String toString() { return instruction.toString() + " (PUSH)"; } }
/** * @return mnemonic for instruction with sumbolic references resolved */ public String toString( final ConstantPool cp ) { return toString(false); }
/** * Long output format: * * <name of opcode> "["<opcode number>"]" * "("<length of instruction>")" "<"< constant pool index>">" * * @param verbose long/short format switch * @return mnemonic for instruction */ public String toString(boolean verbose) { return super.toString(verbose) + " " + index; }
/** * @return mnemonic for instruction in verbose format */ public String toString() { return toString(true); }
/** * @return mnemonic for instruction with sumbolic references resolved */ public String toString(ConstantPool cp) { return toString(false); }
/** * @return mnemonic for instruction */ public String toString(boolean verbose) { return super.toString(verbose) + " " + b; }
/** * @return mnemonic for instruction */ @Override public String toString( final boolean verbose ) { return super.toString(verbose) + " " + b; }
/** * @return mnemonic for instruction */ public String toString(boolean verbose) { return super.toString(verbose) + " " + b; }
/** * Long output format: * * <name of opcode> "["<opcode number>"]" * "("<length of instruction>")" "<"< constant pool index>">" * * @param verbose long/short format switch * @return mnemonic for instruction */ @Override public String toString( final boolean verbose ) { return super.toString(verbose) + " " + index; }
/** @return a (verbose) string representation of the contained instruction. */ public String toString( final boolean verbose ) { return Utility.format(i_position, 4, false, ' ') + ": " + instruction.toString(verbose); }
/** * @return mnemonic for instruction */ @Override public String toString( final boolean verbose ) { return super.toString(verbose) + " " + org.apache.bcel.Const.getTypeName(type); }
/** @return a (verbose) string representation of the contained instruction. */ public String toString(boolean verbose) { return Utility.format(i_position, 4, false, ' ') + ": " + instruction.toString(verbose); }
/** * @param target branch target * @return the offset to `target' relative to this instruction */ protected int getTargetOffset(InstructionHandle target) { if(target == null) throw new ClassGenException("Target of " + super.toString(true) + " is invalid null handle"); int t = target.getPosition(); if(t < 0) throw new ClassGenException("Invalid branch target position offset for " + super.toString(true) + ":" + t + ":" + target); return t - position; }
@Test public void testConstantToString() throws ClassNotFoundException { final JavaClass clazz = getTestClass(PACKAGE_BASE_NAME + ".data.SimpleClassWithDefaultConstructor"); final ConstantPoolGen cp = new ConstantPoolGen(clazz.getConstantPool()); final Method[] methods = clazz.getMethods(); for (final Method method : methods) { if (method.getName().equals("<init>")) { for (final InstructionHandle instructionHandle : getInstructionHandles(clazz, cp, method)) { System.out.println(instructionHandle.getInstruction().toString(cp.getConstantPool())); } } } }