Example usage for org.aspectj.apache.bcel.generic ObjectType ObjectType

List of usage examples for org.aspectj.apache.bcel.generic ObjectType ObjectType

Introduction

In this page you can find the example usage for org.aspectj.apache.bcel.generic ObjectType ObjectType.

Prototype

public ObjectType(String class_name) 

Source Link

Usage

From source file:org.caesarj.mixer.intern.ClassModifyingVisitor.java

License:Open Source License

public void visitLocalVariable(LocalVariable variable) {
    // Change the type of the local variable this
    if (variable.getName().equals("this")) {
        int index = variable.getSignatureIndex();
        ConstantPool cp = variable.getConstantPool();
        Constant newSignature = new ConstantUtf8(new ObjectType(newClassName).getSignature());
        cp.setConstant(index, newSignature);
    }/*from  w ww  .ja v a2 s .  co  m*/
    super.visitLocalVariable(variable);
}

From source file:org.caesarj.mixer.intern.ClassModifyingVisitor.java

License:Open Source License

public void visitField(Field field) {
    // and of outer this
    if (field.getName().startsWith("this$")) {
        int index = field.getSignatureIndex();
        ConstantPool cp = field.getConstantPool();
        Constant newSignature = new ConstantUtf8(new ObjectType(newOuterClassName).getSignature());
        cp.setConstant(index, newSignature);
    }/*from   w  ww  . jav a 2  s .c o  m*/

    super.visitField(field);
}