use of jdk.internal.org.objectweb.asm.tree.MethodInsnNode in project OSJR by zeruth.
the class CanvasInjector method setSuper.
public static void setSuper(ClassNode node, String superClass) {
String replaced = "";
if (!node.superName.equals(""))
replaced = node.superName;
if (!replaced.equals("")) {
for (Object o : node.methods) {
final MethodNode mn = (MethodNode) o;
final ListIterator<?> listIt = mn.instructions.iterator();
while (listIt.hasNext()) {
final AbstractInsnNode ain = (AbstractInsnNode) listIt.next();
if (ain.getOpcode() == Opcodes.INVOKESPECIAL) {
final MethodInsnNode call = (MethodInsnNode) ain;
if (call.owner.equals(replaced))
call.owner = superClass;
}
}
}
}
node.superName = superClass;
}
Aggregations