예제 #1
0
  @Override
  public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {

    super.visitMethodInsn(opcode, owner, name, desc, itf);
  }
예제 #2
0
  public void visitFieldInsn(int opcode, String owner, String name, String desc) {

    if (transientAnnotation) {
      // The whole method is left as is
      super.visitFieldInsn(opcode, owner, name, desc);
      return;
    }

    if (opcode == Opcodes.GETSTATIC || opcode == Opcodes.PUTSTATIC) {
      if (meta.isLog(3)) {
        meta.log(" ... info: skip static field " + owner + " " + name + " in " + methodDescription);
      }
      super.visitFieldInsn(opcode, owner, name, desc);
      return;
    }

    if (isNonPersistentField(owner, name)) {
      if (meta.isLog(3)) {
        meta.log(
            " ... info: non-persistent field " + owner + " " + name + " in " + methodDescription);
      }
      super.visitFieldInsn(opcode, owner, name, desc);
      return;
    }

    // every basicField has a special set of field interception methods
    if (opcode == Opcodes.GETFIELD) {
      String methodName = "_ebean_get_" + name;
      String methodDesc = "()" + desc;
      if (meta.isLog(4)) {
        meta.log(
            "GETFIELD method:"
                + methodDescription
                + " field:"
                + name
                + " > "
                + methodName
                + " "
                + methodDesc);
      }
      super.visitMethodInsn(INVOKEVIRTUAL, className, methodName, methodDesc, false);

    } else if (opcode == Opcodes.PUTFIELD) {
      String methodName = "_ebean_set_" + name;
      String methodDesc = "(" + desc + ")V";
      if (meta.isLog(4)) {
        meta.log(
            "PUTFIELD method:"
                + methodDescription
                + " field:"
                + name
                + " > "
                + methodName
                + " "
                + methodDesc);
      }
      super.visitMethodInsn(INVOKEVIRTUAL, className, methodName, methodDesc, false);

    } else {
      meta.log(
          "Warning adapting method:"
              + methodDescription
              + "; unexpected static access to a persistent field?? "
              + name
              + " opCode not GETFIELD or PUTFIELD??  opCode:"
              + opcode
              + "");

      super.visitFieldInsn(opcode, owner, name, desc);
    }
  }
예제 #3
0
  @Override
  public void visitLocalVariable(
      String name, String desc, String signature, Label start, Label end, int index) {

    super.visitLocalVariable(name, desc, signature, start, end, index);
  }