提交 c416f77e 编写于 作者: S Skylot

core: fix android specific class handler

上级 fde431d1
......@@ -144,15 +144,18 @@ public class InsnGen {
return arg(arg) + "." + name;
}
private String sfield(FieldInfo field) {
protected String sfield(FieldInfo field) {
String thisClass = mth.getParentClass().getFullName();
if (thisClass.startsWith(field.getDeclClass().getFullName())) {
ClassInfo declClass = field.getDeclClass();
if (thisClass.startsWith(declClass.getFullName())) {
return field.getName();
} else if (field.getDeclClass().getFullName().startsWith(mth.getParentClass().getPackage() + ".R")) {
return field.getDeclClass().getNameWithoutPackage() + '.' + field.getName();
} else {
return useClass(field.getDeclClass()) + '.' + field.getName();
}
// Android specific resources class handler
ClassInfo parentClass = declClass.getParentClass();
if (parentClass != null && parentClass.getShortName().equals("R")) {
return useClass(parentClass) + "." + declClass.getShortName() + "." + field.getName();
}
return useClass(declClass) + '.' + field.getName();
}
private void fieldPut(IndexInsnNode insn) {
......
......@@ -308,14 +308,4 @@ public class RegionGen extends InsnGen {
makeRegionIndent(code, region);
}
}
// FIXME: !!code from InsnGen.sfield
private String sfield(FieldInfo field) {
String thisClass = mth.getParentClass().getFullName();
if (thisClass.startsWith(field.getDeclClass().getFullName())) {
return field.getName();
} else {
return useClass(field.getDeclClass()) + '.' + field.getName();
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册