Example usage for org.aspectj.apache.bcel.generic InvokeInstruction getArgumentTypes

List of usage examples for org.aspectj.apache.bcel.generic InvokeInstruction getArgumentTypes

Introduction

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

Prototype

public Type[] getArgumentTypes(ConstantPool cpg) 

Source Link

Usage

From source file:br.jabuti.graph.datastructure.dug.CFGCallNode.java

License:Open Source License

public CFGCallNode(CFGNode x, InstructionNode ins, ConstantPoolGen cp) {
    super(x);/*w w  w  .jav a2s  .  c  o m*/
    InvokeInstruction y = (InvokeInstruction) ins.ih.getInstruction();

    name = y.getMethodName(cp);
    Type[] vt = y.getArgumentTypes(cp);

    param = new String[vt.length];
    for (int i = 0; i < vt.length; i++) {
        param[i] = vt[i].getSignature();
    }

    if (y instanceof INVOKESTATIC || y instanceof INVOKESPECIAL) {
        classe = new String[1];
        classe[0] = y.getClassName(cp);
    } else {
        Vector vtype = new Vector();

        vt = ins.getStackAt(ins.argStackFrom);
        for (int i = 0; i < vt.length; i++) {
            String s = vt[i].getSignature();

            if (!vtype.contains(s)) {
                vtype.add(s);
            }
        }
        classe = (String[]) vtype.toArray(new String[0]);
    }

    specialMethod = NOTHING_SPECIAL;
    for (int i = 0; i < aspectVector.size(); i++) {
        String s = (String) aspectVector.elementAt(i);
        if (name.startsWith(s)) {
            specialMethod = ASPECT_METHOD;
            break;
        }
    }
}