use of net.runelite.asm.ClassFile in project runelite by runelite.
the class InvokeVirtual method lookupMethod.
private net.runelite.asm.Method lookupMethod() {
ClassGroup group = this.getInstructions().getCode().getMethod().getClassFile().getGroup();
ClassFile otherClass = group.findClass(method.getClazz().getName());
if (otherClass == null) {
// not our class
return null;
}
net.runelite.asm.Method m = otherClass.findMethodDeep(method.getName(), method.getType());
return m;
}
use of net.runelite.asm.ClassFile in project runelite by runelite.
the class InvokeSpecial method lookup.
@Override
public void lookup() {
myMethod = null;
ClassGroup group = this.getInstructions().getCode().getMethod().getClassFile().getGroup();
ClassFile otherClass = group.findClass(method.getClazz().getName());
if (otherClass == null) {
// not our class
return;
}
net.runelite.asm.Method other = otherClass.findMethod(method.getName(), method.getType());
if (other == null) {
return;
}
myMethod = other;
}
use of net.runelite.asm.ClassFile in project runelite by runelite.
the class InvokeStatic method lookupMethod.
private net.runelite.asm.Method lookupMethod() {
ClassGroup group = this.getInstructions().getCode().getMethod().getClassFile().getGroup();
ClassFile otherClass = group.findClass(method.getClazz().getName());
if (otherClass == null) {
// not our class
return null;
}
net.runelite.asm.Method other = otherClass.findMethodDeepStatic(method.getName(), method.getType());
if (other == null) {
// when regenerating the pool after renaming the method this can be null.
return null;
}
return other;
}
use of net.runelite.asm.ClassFile in project runelite by runelite.
the class UpdateMappingsTest method desc.
private static String desc(ClassGroup cg) {
int methods = 0, fields = 0, classes = 0;
for (ClassFile cf : cg.getClasses()) {
++classes;
methods += cf.getMethods().size();
fields += cf.getFields().size();
}
int total = methods + fields + classes;
return "total: " + total + ", " + methods + " methods, " + fields + " fields, " + classes + " classes";
}
use of net.runelite.asm.ClassFile in project runelite by runelite.
the class UpdateMappingsTest method check.
private void check(ClassGroup group1, ClassGroup group2) {
for (ClassFile cf : group1.getClasses()) {
ClassFile other = group2.findClass(cf.getName());
String implname = DeobAnnotations.getImplements(cf);
String otherimplname = DeobAnnotations.getImplements(other);
Assert.assertEquals(implname, otherimplname);
for (Field f : cf.getFields()) {
Field otherf = other.findField(f.getName(), f.getType());
assert otherf != null : "unable to find " + f;
String name = DeobAnnotations.getExportedName(f.getAnnotations());
String otherName = DeobAnnotations.getExportedName(otherf.getAnnotations());
Assert.assertEquals(name + " <-> " + otherName, name, otherName);
}
for (Method m : cf.getMethods()) {
Method otherm = other.findMethod(m.getName(), m.getDescriptor());
assert otherm != null : "unable to find " + m;
String name = DeobAnnotations.getExportedName(m.getAnnotations());
String otherName = DeobAnnotations.getExportedName(otherm.getAnnotations());
Assert.assertEquals(name + " <-> " + otherName, name, otherName);
}
}
}
Aggregations