|
|
@ -139,13 +139,19 @@ public class ClassWrapper { |
|
|
|
VarNamesCollector namesCollector = new VarNamesCollector(); |
|
|
|
VarNamesCollector namesCollector = new VarNamesCollector(); |
|
|
|
classStruct.getFields().forEach(f -> namesCollector.addName(f.getName())); |
|
|
|
classStruct.getFields().forEach(f -> namesCollector.addName(f.getName())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int index = mt.hasModifier(CodeConstants.ACC_STATIC) ? 0 : 1; |
|
|
|
|
|
|
|
for (int i = 0; i < md.params.length; i++) { |
|
|
|
|
|
|
|
varProc.setVarName(new VarVersionPair(index, 0), "arg" + i); |
|
|
|
|
|
|
|
index += md.params[i].stackSize; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Map<Integer, String> paramNames = new HashMap<>(); |
|
|
|
Map<Integer, String> paramNames = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
if (DecompilerContext.getOption(IFernflowerPreferences.USE_METHOD_PARAMETERS)) { |
|
|
|
if (DecompilerContext.getOption(IFernflowerPreferences.USE_METHOD_PARAMETERS)) { |
|
|
|
StructMethodParametersAttribute attr = mt.getAttribute(StructGeneralAttribute.ATTRIBUTE_METHOD_PARAMETERS); |
|
|
|
StructMethodParametersAttribute attr = mt.getAttribute(StructGeneralAttribute.ATTRIBUTE_METHOD_PARAMETERS); |
|
|
|
if (attr != null) { |
|
|
|
if (attr != null) { |
|
|
|
List<StructMethodParametersAttribute.Entry> entries = attr.getEntries(); |
|
|
|
List<StructMethodParametersAttribute.Entry> entries = attr.getEntries(); |
|
|
|
int index = mt.hasModifier(CodeConstants.ACC_STATIC) ? 0 : 1; |
|
|
|
index = mt.hasModifier(CodeConstants.ACC_STATIC) ? 0 : 1; |
|
|
|
for (int i = 0; i < md.params.length && i < entries.size(); i++) { |
|
|
|
for (int i = 0; i < md.params.length && i < entries.size(); i++) { |
|
|
|
String myName = entries.get(i).myName; |
|
|
|
String myName = entries.get(i).myName; |
|
|
|
if (myName != null) { |
|
|
|
if (myName != null) { |
|
|
@ -210,11 +216,13 @@ public class ClassWrapper { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int pc = originalPcTable.getOriginalPc(bytecodeOffset); |
|
|
|
int pc = originalPcTable.getOriginalPc(bytecodeOffset); |
|
|
|
if (!originalPcTable.hasName(pc)) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String name = originalPcTable.getName(pc); |
|
|
|
String name; |
|
|
|
|
|
|
|
if (originalPcTable.hasName(pc)) { |
|
|
|
|
|
|
|
name = originalPcTable.getName(pc); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
name = "local" + pc; |
|
|
|
|
|
|
|
} |
|
|
|
varProc.setVarName(varExpr.getVarVersionPair(), name); |
|
|
|
varProc.setVarName(varExpr.getVarVersionPair(), name); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|