From 2af35f2528dc91b16de1f371aeb4bdb6e994fa6d Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 5 May 1999 20:49:24 +0000 Subject: [PATCH] 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 --- jode/jode/decompiler/LocalInfo.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/jode/jode/decompiler/LocalInfo.java b/jode/jode/decompiler/LocalInfo.java index 11fd05a..af1af8c 100644 --- a/jode/jode/decompiler/LocalInfo.java +++ b/jode/jode/decompiler/LocalInfo.java @@ -68,6 +68,10 @@ public class LocalInfo { this.slot = slot; } + public static void init() { + serialnr = 0; + } + public void setOperator(LocalVarOperator operator) { getLocalInfo().operators.addElement(operator); } @@ -171,14 +175,20 @@ public class LocalInfo { } } nameIsGenerated = true; - if ((Decompiler.options & Decompiler.OPTION_PRETTY) != 0 - && type != null) { - name = type.getHint().getDefaultName(); + setType(type.getHint()); + if ((Decompiler.options & Decompiler.OPTION_PRETTY) != 0) { + name = type.getDefaultName(); } else { - name = type.getHint().getDefaultName() + name = type.getDefaultName() + (slot >= 0 ? "_" + slot : "") + "_" + serialnr++ + "_"; isUnique = true; } + if ((GlobalOptions.debuggingFlags + & GlobalOptions.DEBUG_LOCALS) != 0) { + GlobalOptions.err.println("Guessed name: " + name + + " from type: " + type); + Thread.dumpStack(); + } } return name; } @@ -284,7 +294,7 @@ public class LocalInfo { } public boolean isRemoved() { - return true; + return removed; } public String toString() {