Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.FieldInsnNode


    }

    public MethodDefinition putStaticField(ParameterizedType target, String fieldName, ParameterizedType fieldType)
    {
        instructionList.add(
                new FieldInsnNode(
                        PUTSTATIC,
                        target.getClassName(),
                        fieldName,
                        fieldType.getType()
                )
View Full Code Here


    public MethodDefinition putField(ParameterizedType target, FieldDefinition field)
    {
        checkArgument(!field.getAccess().contains(STATIC), "Field is static: %s", field);

        instructionList.add(
                new FieldInsnNode(
                        PUTFIELD,
                        target.getClassName(),
                        field.getName(),
                        field.getType().getType()
                )
View Full Code Here

    }

    public MethodDefinition putField(ParameterizedType target, String fieldName, ParameterizedType fieldType)
    {
        instructionList.add(
                new FieldInsnNode(
                        PUTFIELD,
                        target.getClassName(),
                        fieldName,
                        fieldType.getType()
                )
View Full Code Here

            case IF_ACMPNE:
                expected1 = BasicValue.REFERENCE_VALUE;
                expected2 = BasicValue.REFERENCE_VALUE;
                break;
            case PUTFIELD:
                FieldInsnNode fin = (FieldInsnNode) insn;
                expected1 = newValue(Type.getObjectType(fin.owner));
                expected2 = newValue(Type.getType(fin.desc));
                break;
            default:
                throw new Error("Internal error.");
View Full Code Here

        // Initializations of fields end up placed in generated methods (<init>
        // for members and <clinit> for static fields).
        if (instruction != null && method.name.charAt(0) == '<') {
            AbstractInsnNode next = LintUtils.getNextInstruction(instruction);
            if (next != null && next.getType() == AbstractInsnNode.FIELD_INSN) {
                FieldInsnNode fieldRef = (FieldInsnNode) next;
                FieldNode field = findField(classNode, fieldRef.owner, fieldRef.name);
                if (field != null && isSuppressed(issue, field)) {
                    return true;
                }
            } else if (classNode.outerClass != null && classNode.outerMethod == null
View Full Code Here

        // Initializations of fields end up placed in generated methods (<init>
        // for members and <clinit> for static fields).
        if (instruction != null && method.name.charAt(0) == '<') {
            AbstractInsnNode next = LintUtils.getNextInstruction(instruction);
            if (next != null && next.getType() == AbstractInsnNode.FIELD_INSN) {
                FieldInsnNode fieldRef = (FieldInsnNode) next;
                FieldNode field = findField(classNode, fieldRef.owner, fieldRef.name);
                if (field != null && isSuppressed(issue, field)) {
                    return true;
                }
            } else if (classNode.outerClass != null && classNode.outerMethod == null
View Full Code Here

        "java/lang/Object"));
  }

  @Test
  public void testFieldInsn() {
    testInstructionBetweenFrames(new FieldInsnNode(Opcodes.GETFIELD, "Foo",
        "f", "I"));
  }
View Full Code Here

            return new ConstantValue.IntegerConstant(intInsn.operand);
         }
         case GETSTATIC:
         {
            assert(insn instanceof FieldInsnNode);
            FieldInsnNode fieldInsn = (FieldInsnNode)insn;
            return new TypedValue.GetStaticFieldValue(fieldInsn.owner, fieldInsn.name, fieldInsn.desc);
         }
         case JSR:
         default:
            throw new AnalyzerException(insn, "Unhandled bytecode instruction");
View Full Code Here

    super(api);
  }

  private TypedValue createGetFieldTypedValue(AbstractInsnNode insn, Value base)
   {
      FieldInsnNode fieldInsn = (FieldInsnNode)insn;
      return new TypedValue.GetFieldValue(fieldInsn.owner, fieldInsn.name, fieldInsn.desc, (TypedValue)base);
   }
View Full Code Here

      {
         if (value1 instanceof TypedValue.ThisValue)
         {
            if (methodChecker != null && methodChecker.isPutFieldAllowed())
            {
               FieldInsnNode fieldInsn = (FieldInsnNode)insn;
               sideEffects.add(new MethodSideEffectFieldAssign(fieldInsn.owner, fieldInsn.name, fieldInsn.desc, (TypedValue)value1, (TypedValue)value2));
               return null;
            }
         }
      }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.tree.FieldInsnNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.