Search in sources :

Example 1 with Annotation

use of com.jopdesign.common.bcel.Annotation in project jop by jop-devel.

the class MemberInfo method setUnusedAnnotation.

public void setUnusedAnnotation() {
    AnnotationAttribute a = getAnnotation(false, true);
    if (a.findAnnotation(AnnotationAttribute.UNUSED_TAG_NAME) != null)
        return;
    ConstantPoolGen cpg = getConstantPoolGen();
    int nameIdx = cpg.addUtf8(AnnotationAttribute.UNUSED_TAG_NAME);
    Annotation an = new Annotation(nameIdx, cpg.getConstantPool(), 0);
    a.addAnnotation(an);
}
Also used : ConstantPoolGen(org.apache.bcel.generic.ConstantPoolGen) AnnotationAttribute(com.jopdesign.common.bcel.AnnotationAttribute) Annotation(com.jopdesign.common.bcel.Annotation)

Example 2 with Annotation

use of com.jopdesign.common.bcel.Annotation in project jop by jop-devel.

the class MemberInfo method removeUnusedAnnotation.

public void removeUnusedAnnotation() {
    AnnotationAttribute a = getAnnotation(false, false);
    if (a == null)
        return;
    Annotation an = a.findAnnotation(AnnotationAttribute.UNUSED_TAG_NAME);
    if (an != null) {
        a.removeAnnotation(an);
    }
}
Also used : AnnotationAttribute(com.jopdesign.common.bcel.AnnotationAttribute) Annotation(com.jopdesign.common.bcel.Annotation)

Aggregations

Annotation (com.jopdesign.common.bcel.Annotation)2 AnnotationAttribute (com.jopdesign.common.bcel.AnnotationAttribute)2 ConstantPoolGen (org.apache.bcel.generic.ConstantPoolGen)1