use of com.jopdesign.common.misc.JavaClassFormatError in project jop by jop-devel.
the class RelinkInvokesuper method relinkInvokeSuper.
private void relinkInvokeSuper(InvokeSite is) {
// this already resolves to the correct method..
MethodRef invokee = is.getInvokeeRef();
MethodInfo target = invokee.getMethodInfo();
if (target == null) {
// .. or not (class or method excluded or unknown)
logger.warn("Cannot try to relink invokespecial to unknown super method " + invokee);
return;
}
// now simply relink instruction (no need to check if it changes)
int index = is.getInvoker().getClassInfo().addConstantInfo(new ConstantMethodInfo(invokee));
if (!(is.getInvokeInstruction() instanceof INVOKESPECIAL)) {
throw new JavaClassFormatError("Invokesuper is not an invokespecial instruction!");
}
is.getInvokeInstruction().setIndex(index);
}
Aggregations