use of org.apache.bcel.classfile.BootstrapMethods in project fb-contrib by mebigfatguy.
the class OverlyPermissiveMethod method getBootstrapMethod.
@Nullable
private BootstrapMethod getBootstrapMethod(int bootstrapIndex) {
for (Attribute a : cls.getAttributes()) {
if ("BootstrapMethods".equals(a.getName())) {
if (a instanceof BootstrapMethods) {
BootstrapMethods bma = (BootstrapMethods) a;
BootstrapMethod[] methods = bma.getBootstrapMethods();
if (bootstrapIndex >= methods.length) {
return null;
}
return methods[bootstrapIndex];
}
throw new RuntimeException("Incompatible bcel version, the bcel that is in use, is too old and doesn't have attribute 'BootstrapMethods'");
}
}
return null;
}
Aggregations