/** * Helper method to return the comment for a branch. * * @param insn {@code non-null;} the instruction in question * @return {@code non-null;} the comment */ protected static String branchComment(DalvInsn insn) { TargetInsn ti = (TargetInsn) insn; int offset = ti.getTargetOffset(); return (offset == (short) offset) ? Hex.s2(offset) : Hex.s4(offset); }
/** * Helper method to return the comment for a branch. * * @param insn {@code non-null;} the instruction in question * @return {@code non-null;} the comment */ protected static String branchComment(DalvInsn insn) { TargetInsn ti = (TargetInsn) insn; int offset = ti.getTargetOffset(); return (offset == (short) offset) ? Hex.s2(offset) : Hex.s4(offset); }
/** * Helper method to return the comment for a branch. * * @param insn {@code non-null;} the instruction in question * @return {@code non-null;} the comment */ protected static String branchComment(DalvInsn insn) { TargetInsn ti = (TargetInsn) insn; int offset = ti.getTargetOffset(); return (offset == (short) offset) ? Hex.s2(offset) : Hex.s4(offset); }
/** * Helper method to return the comment for a branch. * * @param insn {@code non-null;} the instruction in question * @return {@code non-null;} the comment */ protected static String branchComment(DalvInsn insn) { TargetInsn ti = (TargetInsn) insn; int offset = ti.getTargetOffset(); return (offset == (short) offset) ? Hex.s2(offset) : Hex.s4(offset); }
/** * Helper method to return the comment for a branch. * * @param insn {@code non-null;} the instruction in question * @return {@code non-null;} the comment */ protected static String branchComment(DalvInsn insn) { TargetInsn ti = (TargetInsn) insn; int offset = ti.getTargetOffset(); return (offset == (short) offset) ? Hex.s2(offset) : Hex.s4(offset); }
/** * Helper method to return the comment for a branch. * * @param insn {@code non-null;} the instruction in question * @return {@code non-null;} the comment */ protected static String branchComment(DalvInsn insn) { TargetInsn ti = (TargetInsn) insn; int offset = ti.getTargetOffset(); return (offset == (short) offset) ? Hex.s2(offset) : Hex.s4(offset); }
/** * Helper method to return the comment for a branch. * * @param insn {@code non-null;} the instruction in question * @return {@code non-null;} the comment */ protected static String branchComment(DalvInsn insn) { TargetInsn ti = (TargetInsn) insn; int offset = ti.getTargetOffset(); return (offset == (short) offset) ? Hex.s2(offset) : Hex.s4(offset); }
/** * Helper method to return the comment for a branch. * * @param insn {@code non-null;} the instruction in question * @return {@code non-null;} the comment */ protected static String branchComment(DalvInsn insn) { TargetInsn ti = (TargetInsn) insn; int offset = ti.getTargetOffset(); return (offset == (short) offset) ? Hex.s2(offset) : Hex.s4(offset); }
/** * Helper for {@link #visitConstant} where the constant is an * {@code int}. * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length * @param value constant value */ private void visitLiteralInt(int opcode, int offset, int length, int value) { String commentOrSpace = (length == 1) ? " // " : " "; String valueStr; opcode = bytes.getUnsignedByte(offset); // Compare with orig op below. if ((length == 1) || (opcode == ByteOps.BIPUSH)) { valueStr = "#" + Hex.s1(value); } else if (opcode == ByteOps.SIPUSH) { valueStr = "#" + Hex.s2(value); } else { valueStr = "#" + Hex.s4(value); } observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + valueStr); }
/** * Helper for {@link #visitConstant} where the constant is an * {@code int}. * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length * @param value constant value */ private void visitLiteralInt(int opcode, int offset, int length, int value) { String commentOrSpace = (length == 1) ? " // " : " "; String valueStr; opcode = bytes.getUnsignedByte(offset); // Compare with orig op below. if ((length == 1) || (opcode == ByteOps.BIPUSH)) { valueStr = "#" + Hex.s1(value); } else if (opcode == ByteOps.SIPUSH) { valueStr = "#" + Hex.s2(value); } else { valueStr = "#" + Hex.s4(value); } observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + valueStr); }
/** * Helper for {@link #visitConstant} where the constant is an * {@code int}. * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length * @param value constant value */ private void visitLiteralInt(int opcode, int offset, int length, int value) { String commentOrSpace = (length == 1) ? " // " : " "; String valueStr; opcode = bytes.getUnsignedByte(offset); // Compare with orig op below. if ((length == 1) || (opcode == ByteOps.BIPUSH)) { valueStr = "#" + Hex.s1(value); } else if (opcode == ByteOps.SIPUSH) { valueStr = "#" + Hex.s2(value); } else { valueStr = "#" + Hex.s4(value); } observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + valueStr); }
/** * Helper for {@link #visitConstant} where the constant is an * {@code int}. * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length * @param value constant value */ private void visitLiteralInt(int opcode, int offset, int length, int value) { String commentOrSpace = (length == 1) ? " // " : " "; String valueStr; opcode = bytes.getUnsignedByte(offset); // Compare with orig op below. if ((length == 1) || (opcode == ByteOps.BIPUSH)) { valueStr = "#" + Hex.s1(value); } else if (opcode == ByteOps.SIPUSH) { valueStr = "#" + Hex.s2(value); } else { valueStr = "#" + Hex.s4(value); } observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + valueStr); }
/** * Helper for {@link #visitConstant} where the constant is an * {@code int}. * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length * @param value constant value */ private void visitLiteralInt(int opcode, int offset, int length, int value) { String commentOrSpace = (length == 1) ? " // " : " "; String valueStr; opcode = bytes.getUnsignedByte(offset); // Compare with orig op below. if ((length == 1) || (opcode == ByteOps.BIPUSH)) { valueStr = "#" + Hex.s1(value); } else if (opcode == ByteOps.SIPUSH) { valueStr = "#" + Hex.s2(value); } else { valueStr = "#" + Hex.s4(value); } observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + valueStr); }
/** {@inheritDoc} */ public void visitLocal(int opcode, int offset, int length, int idx, Type type, int value) { String idxStr = (length <= 3) ? Hex.u1(idx) : Hex.u2(idx); boolean argComment = (length == 1); String valueStr = ""; if (opcode == ByteOps.IINC) { valueStr = ", #" + ((length <= 3) ? Hex.s1(value) : Hex.s2(value)); } String catStr = ""; if (type.isCategory2()) { catStr = (argComment ? "," : " //") + " category-2"; } observer.parsed(bytes, offset, length, header(offset) + (argComment ? " // " : " ") + idxStr + valueStr + catStr); }
/** * Helper for {@link #visitConstant} where the constant is an * {@code int}. * * @param opcode the opcode * @param offset offset to the instruction * @param length instruction length * @param value constant value */ private void visitLiteralInt(int opcode, int offset, int length, int value) { String commentOrSpace = (length == 1) ? " // " : " "; String valueStr; opcode = bytes.getUnsignedByte(offset); // Compare with orig op below. if ((length == 1) || (opcode == ByteOps.BIPUSH)) { valueStr = "#" + Hex.s1(value); } else if (opcode == ByteOps.SIPUSH) { valueStr = "#" + Hex.s2(value); } else { valueStr = "#" + Hex.s4(value); } observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + valueStr); }
/** {@inheritDoc} */ @Override public void visitLocal(int opcode, int offset, int length, int idx, Type type, int value) { String idxStr = (length <= 3) ? Hex.u1(idx) : Hex.u2(idx); boolean argComment = (length == 1); String valueStr = ""; if (opcode == ByteOps.IINC) { valueStr = ", #" + ((length <= 3) ? Hex.s1(value) : Hex.s2(value)); } String catStr = ""; if (type.isCategory2()) { catStr = (argComment ? "," : " //") + " category-2"; } observer.parsed(bytes, offset, length, header(offset) + (argComment ? " // " : " ") + idxStr + valueStr + catStr); }
/** {@inheritDoc} */ public void visitLocal(int opcode, int offset, int length, int idx, Type type, int value) { String idxStr = (length <= 3) ? Hex.u1(idx) : Hex.u2(idx); boolean argComment = (length == 1); String valueStr = ""; if (opcode == ByteOps.IINC) { valueStr = ", #" + ((length <= 3) ? Hex.s1(value) : Hex.s2(value)); } String catStr = ""; if (type.isCategory2()) { catStr = (argComment ? "," : " //") + " category-2"; } observer.parsed(bytes, offset, length, header(offset) + (argComment ? " // " : " ") + idxStr + valueStr + catStr); }
/** {@inheritDoc} */ public void visitLocal(int opcode, int offset, int length, int idx, Type type, int value) { String idxStr = (length <= 3) ? Hex.u1(idx) : Hex.u2(idx); boolean argComment = (length == 1); String valueStr = ""; if (opcode == ByteOps.IINC) { valueStr = ", #" + ((length <= 3) ? Hex.s1(value) : Hex.s2(value)); } String catStr = ""; if (type.isCategory2()) { catStr = (argComment ? "," : " //") + " category-2"; } observer.parsed(bytes, offset, length, header(offset) + (argComment ? " // " : " ") + idxStr + valueStr + catStr); }
/** {@inheritDoc} */ @Override public void visitLocal(int opcode, int offset, int length, int idx, Type type, int value) { String idxStr = (length <= 3) ? Hex.u1(idx) : Hex.u2(idx); boolean argComment = (length == 1); String valueStr = ""; if (opcode == ByteOps.IINC) { valueStr = ", #" + ((length <= 3) ? Hex.s1(value) : Hex.s2(value)); } String catStr = ""; if (type.isCategory2()) { catStr = (argComment ? "," : " //") + " category-2"; } observer.parsed(bytes, offset, length, header(offset) + (argComment ? " // " : " ") + idxStr + valueStr + catStr); }
/** {@inheritDoc} */ public void visitLocal(int opcode, int offset, int length, int idx, Type type, int value) { String idxStr = (length <= 3) ? Hex.u1(idx) : Hex.u2(idx); boolean argComment = (length == 1); String valueStr = ""; if (opcode == ByteOps.IINC) { valueStr = ", #" + ((length <= 3) ? Hex.s1(value) : Hex.s2(value)); } String catStr = ""; if (type.isCategory2()) { catStr = (argComment ? "," : " //") + " category-2"; } observer.parsed(bytes, offset, length, header(offset) + (argComment ? " // " : " ") + idxStr + valueStr + catStr); }