change the name "local" to type dependant name

new method hasName


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@174 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent f951665f53
commit 4c81308913
  1. 12
      jode/jode/decompiler/LocalInfo.java

@ -117,6 +117,13 @@ public class LocalInfo {
return this; return this;
} }
/**
* Returns true if the local already has a name.
*/
public boolean hasName() {
return getLocalInfo().name != null;
}
/** /**
* Get the name of this local. * Get the name of this local.
*/ */
@ -131,7 +138,8 @@ public class LocalInfo {
if (jode.Decompiler.prettyLocals && type != null) { if (jode.Decompiler.prettyLocals && type != null) {
name = type.getDefaultName(); name = type.getDefaultName();
} else { } else {
name = "local_"+slot+"__"+serialnr+++"_"; name = type.getDefaultName() +
"_" + slot + "_" + serialnr++ + "_";
isUnique = true; isUnique = true;
} }
} }
@ -161,7 +169,7 @@ public class LocalInfo {
LocalInfo li = getLocalInfo(); LocalInfo li = getLocalInfo();
String name = li.getName(); String name = li.getName();
if (!li.isUnique) { if (!li.isUnique) {
li.name = name + "__"+serialnr+++"_"; li.name = name + "_" + serialnr++ + "_";
li.isUnique = true; li.isUnique = true;
} }
} }

Loading…
Cancel
Save