ArrayList<JavaMethod> methods = baseClass.getMethodList();
// Move the __super methods
ArrayList<JavaMethod> extMethods = extClass.getMethodList();
for (int i = 0; i < extMethods.size(); i++) {
JavaMethod extMethod = extMethods.get(i);
fixupExtMethod(baseClass, extClass, extMethod);
String baseName = extMethod.getName();
if (baseName.endsWith("__super"))
continue;
String superName = baseName + "__super";
int j;
for (j = 0; j < methods.size(); j++) {
JavaMethod method = methods.get(j);
String type = method.getDescriptor();
if (! method.getName().equals(baseName)
|| ! method.getDescriptor().equals(extMethod.getDescriptor()))
continue;
if (baseName.equals("<init>")) {
baseClass.getConstantPool().addUTF8("__init__super");
mergeInitMethods(baseClass, method, extClass, extMethod);
break;
}
if (baseName.equals("<clinit>")) {
concatenateMethods(baseClass, method, extClass, extMethod);
break;
}
baseClass.getConstantPool().addUTF8(superName);
method.setName(superName);
baseClass.getConstantPool().addUTF8(type);
method.setDescriptor(type);
// set the super methods private
int flags = method.getAccessFlags();
flags = (flags & ~ACC_PUBLIC & ~ACC_PROTECTED) | ACC_PRIVATE;
method.setAccessFlags(flags);
break;
}
}
}