setType, when guessing names.

init() added (clears serialnr)


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@762 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 6cac3aa688
commit 2af35f2528
  1. 20
      jode/jode/decompiler/LocalInfo.java

@ -68,6 +68,10 @@ public class LocalInfo {
this.slot = slot; this.slot = slot;
} }
public static void init() {
serialnr = 0;
}
public void setOperator(LocalVarOperator operator) { public void setOperator(LocalVarOperator operator) {
getLocalInfo().operators.addElement(operator); getLocalInfo().operators.addElement(operator);
} }
@ -171,14 +175,20 @@ public class LocalInfo {
} }
} }
nameIsGenerated = true; nameIsGenerated = true;
if ((Decompiler.options & Decompiler.OPTION_PRETTY) != 0 setType(type.getHint());
&& type != null) { if ((Decompiler.options & Decompiler.OPTION_PRETTY) != 0) {
name = type.getHint().getDefaultName(); name = type.getDefaultName();
} else { } else {
name = type.getHint().getDefaultName() name = type.getDefaultName()
+ (slot >= 0 ? "_" + slot : "") + "_" + serialnr++ + "_"; + (slot >= 0 ? "_" + slot : "") + "_" + serialnr++ + "_";
isUnique = true; isUnique = true;
} }
if ((GlobalOptions.debuggingFlags
& GlobalOptions.DEBUG_LOCALS) != 0) {
GlobalOptions.err.println("Guessed name: " + name
+ " from type: " + type);
Thread.dumpStack();
}
} }
return name; return name;
} }
@ -284,7 +294,7 @@ public class LocalInfo {
} }
public boolean isRemoved() { public boolean isRemoved() {
return true; return removed;
} }
public String toString() { public String toString() {

Loading…
Cancel
Save