Example usage for org.aspectj.apache.bcel.classfile LocalVariable getConstantPool

List of usage examples for org.aspectj.apache.bcel.classfile LocalVariable getConstantPool

Introduction

In this page you can find the example usage for org.aspectj.apache.bcel.classfile LocalVariable getConstantPool.

Prototype

public final ConstantPool getConstantPool() 

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   www  .j av a2s .co  m*/
    super.visitLocalVariable(variable);
}