コード例 #1
1
  protected String printVarInsnNode(VarInsnNode vin, ListIterator<?> it) {
    StringBuilder sb = new StringBuilder();
    sb.append(nameOpcode(vin.opcode()));
    sb.append(vin.var);
    if (Decompiler.BYTECODE.getSettings().isSelected(ClassNodeDecompiler.Settings.DEBUG_HELPERS)) {
      if (vin.var == 0 && !Modifier.isStatic(mNode.access)) {
        sb.append(" // reference to self");
      } else {
        final int refIndex = vin.var - (Modifier.isStatic(mNode.access) ? 0 : 1);
        if (refIndex >= 0 && refIndex < args.length - 1) {
          sb.append(" // reference to " + args[refIndex].name);
        }
      }
    }

    return sb.toString();
  }
コード例 #2
0
  protected String printMethodInsnNode(MethodInsnNode min, ListIterator<?> it) {
    StringBuilder sb = new StringBuilder();
    sb.append(nameOpcode(min.opcode()) + " " + min.owner + " " + min.name + "(");

    String desc = min.desc;
    try {
      if (Type.getType(min.desc) != null) desc = Type.getType(min.desc).getClassName();

      if (desc == null || desc.equals("null")) desc = min.desc;
    } catch (java.lang.ArrayIndexOutOfBoundsException e) {

    }

    sb.append(desc);

    sb.append(");");

    return sb.toString();
  }
コード例 #3
0
  protected String printInvokeDynamicInsNode(InvokeDynamicInsnNode idin) {
    StringBuilder sb = new StringBuilder();
    sb.append(nameOpcode(idin.opcode()) + " " + idin.bsm.getName() + "(");

    String desc = idin.desc;
    String partedDesc = idin.desc.substring(2);
    try {
      if (Type.getType(partedDesc) != null) desc = Type.getType(partedDesc).getClassName();

      if (desc == null || desc.equals("null")) desc = idin.desc;
    } catch (java.lang.ArrayIndexOutOfBoundsException e) {

    }

    sb.append(desc);

    sb.append(");");

    return sb.toString();
  }
コード例 #4
0
 private void log(String msg) {
   out.append(msg);
   out.append(BytecodeViewer.nl);
 }