Examples of FieldGen


Examples of org.aspectj.apache.bcel.generic.FieldGen

      }

      // Do we need to calculate an SUID and add it?
      if (!getType().isInterface() && !hasSerialVersionUIDField && world.isAddSerialVerUID()) {
        calculatedSerialVersionUID = myGen.getSUID();
        FieldGen fg = new FieldGen(Constants.ACC_PRIVATE | Constants.ACC_FINAL | Constants.ACC_STATIC, BasicType.LONG,
            "serialVersionUID", getConstantPool());
        addField(fg);
        hasSerialVersionUIDField = true;
        serialVersionUIDRequiresInitialization = true;
        // warn about what we've done?
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.FieldGen

            // System.out.println("tjp counter starting at " + tjpFieldsCounter);
          }
        }
      }
    }
    FieldGen fGen = new FieldGen(modifiers, jpType, "ajc$tjp_" + tjpFieldsCounter++, getConstantPool());
    addField(fGen);
    tjpField = fGen.getField();
    tjpFields.put(shadow, tjpField);
    return tjpField;
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.FieldGen

    if (field == null) {
      // private static Annotation ajc$anno$<nnn>
      StringBuilder sb = new StringBuilder();
      sb.append(NameMangler.ANNOTATION_CACHE_FIELD_NAME);
      sb.append(annoFieldsCounter++);
      FieldGen annotationCacheField = new FieldGen(Modifier.PRIVATE | Modifier.STATIC, typeForAnnotation, sb.toString(), cp);
      addField(annotationCacheField);
      field = annotationCacheField.getField();
      annotationCachingFieldCache.put(cacheKey, field);
    }
    return field;
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.FieldGen

        parttwo.append(InstructionFactory.createStore(clazzType, slotForThis)); // ? should be the real type ? String or
        // something?
        parttwo.append(InstructionFactory.MONITORENTER);

        String fieldname = synchronizedMethod.getEnclosingClass().allocateField("class$");
        FieldGen f = new FieldGen(Modifier.STATIC | Modifier.PRIVATE, Type.getType(Class.class), fieldname,
            synchronizedMethod.getEnclosingClass().getConstantPool());
        synchronizedMethod.getEnclosingClass().addField(f, null);

        // 10: invokestatic #44; //Method
        // java/lang/Class.forName:(Ljava/lang/String;)Ljava/lang/Class;
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.FieldGen

        parttwo.append(InstructionFactory.createStore(clazzType, slotForThis)); // ? should be the real type ? String or
        // something?
        parttwo.append(InstructionFactory.MONITORENTER);

        String fieldname = synchronizedMethod.getEnclosingClass().allocateField("class$");
        FieldGen f = new FieldGen(Modifier.STATIC | Modifier.PRIVATE, Type.getType(Class.class), fieldname,
            synchronizedMethod.getEnclosingClass().getConstantPool());
        synchronizedMethod.getEnclosingClass().addField(f, null);

        // 10: invokestatic #44; //Method
        // java/lang/Class.forName:(Ljava/lang/String;)Ljava/lang/Class;
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.FieldGen

      }

      // Do we need to calculate an SUID and add it?
      if (!getType().isInterface() && !hasSerialVersionUIDField && world.isAddSerialVerUID()) {
        calculatedSerialVersionUID = myGen.getSUID();
        FieldGen fg = new FieldGen(Constants.ACC_PRIVATE | Constants.ACC_FINAL | Constants.ACC_STATIC, BasicType.LONG,
            "serialVersionUID", getConstantPool());
        addField(fg);
        hasSerialVersionUIDField = true;
        serialVersionUIDRequiresInitialization = true;
        // warn about what we've done?
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.FieldGen

            // System.out.println("tjp counter starting at " + tjpFieldsCounter);
          }
        }
      }
    }
    FieldGen fGen = new FieldGen(modifiers, jpType, "ajc$tjp_" + tjpFieldsCounter++, getConstantPool());
    addField(fGen);
    tjpField = fGen.getField();
    tjpFields.put(shadow, tjpField);
    return tjpField;
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.FieldGen

    if (field == null) {
      // private static Annotation ajc$anno$<nnn>
      StringBuilder sb = new StringBuilder();
      sb.append(NameMangler.ANNOTATION_CACHE_FIELD_NAME);
      sb.append(annoFieldsCounter++);
      FieldGen annotationCacheField = new FieldGen(Modifier.PRIVATE | Modifier.STATIC, typeForAnnotation, sb.toString(), cp);
      addField(annotationCacheField);
      field = annotationCacheField.getField();
      annotationCachingFieldCache.put(cacheKey, field);
    }
    return field;
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.FieldGen

    if (!gen.getType().equals(cflowCounterField.getDeclaringType()))
      return false;

    // Create the field declaration.
    // Something like: "public static final CflowCounter ajc$cflowCounter$0;"
    FieldGen f = new FieldGen(cflowCounterField.getModifiers(), BcelWorld.makeBcelType(cflowCounterField.getReturnType()),
        cflowCounterField.getName(), gen.getConstantPool());

    gen.addField(f, getSourceLocation());

    // Modify the ajc$preClinit() method to initialize it.
View Full Code Here

Examples of org.aspectj.apache.bcel.generic.FieldGen

      for (Definition.DeclareErrorOrWarning deow : concreteAspect.deows) {
        // Building this:
        // @DeclareWarning("call(* javax.sql..*(..)) && !within(org.xyz.daos..*)")
        // static final String aMessage = "Only DAOs should be calling JDBC.";

        FieldGen field = new FieldGen(Modifier.FINAL, ObjectType.STRING, "rule" + (counter++), cg.getConstantPool());
        SimpleElementValue svg = new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), deow.pointcut);
        List<NameValuePair> elems = new ArrayList<NameValuePair>();
        elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
        AnnotationGen mag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Declare"
            + (deow.isError ? "Error" : "Warning")), elems, true, cg.getConstantPool());
        field.addAnnotation(mag);

        field.setValue(deow.message);
        cg.addField(field, null);
      }
    }

    if (concreteAspect.pointcutsAndAdvice.size() > 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.