Search in sources :

Example 1 with Unknown

use of org.apache.bcel.classfile.Unknown in project fb-contrib by mebigfatguy.

the class FunctionalInterfaceIssues method getMethodHandle.

private ConstantMethodHandle getMethodHandle(int bootstrapIndex) {
    int offset = bootstrapIndex * 6;
    byte[] attBytes = ((Unknown) bootstrapAtt).getBytes();
    int methodRefIndex = CodeByteUtils.getshort(attBytes, offset += 2);
    int numArgs = CodeByteUtils.getshort(attBytes, offset += 2);
    for (int i = 0; i < numArgs; i++) {
        int arg = CodeByteUtils.getshort(attBytes, offset += 2);
        Constant c = getConstantPool().getConstant(arg);
        if (c instanceof ConstantMethodHandle) {
            return (ConstantMethodHandle) c;
        }
    }
    return null;
}
Also used : Unknown(org.apache.bcel.classfile.Unknown) Constant(org.apache.bcel.classfile.Constant) ConstantMethodHandle(org.apache.bcel.classfile.ConstantMethodHandle)

Aggregations

Constant (org.apache.bcel.classfile.Constant)1 ConstantMethodHandle (org.apache.bcel.classfile.ConstantMethodHandle)1 Unknown (org.apache.bcel.classfile.Unknown)1