bug fix: setAlias even if representative is stripped

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@339 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 8a4b992d2a
commit 9a58e16d4c
  1. 14
      jode/jode/obfuscator/Identifier.java

@ -33,6 +33,7 @@ public abstract class Identifier {
private boolean preserved = false; private boolean preserved = false;
private String alias = null; private String alias = null;
private boolean wasAliased = false;
public Identifier(String alias) { public Identifier(String alias) {
this.alias = alias; this.alias = alias;
@ -156,11 +157,14 @@ public abstract class Identifier {
if (isPreserved()) { if (isPreserved()) {
if (Obfuscator.isDebugging) if (Obfuscator.isDebugging)
Obfuscator.err.println(toString() + " is preserved"); Obfuscator.err.println(toString() + " is preserved");
} else if (isRepresentative() } else if (renameRule != Obfuscator.RENAME_NONE) {
&& renameRule != Obfuscator.RENAME_NONE) { Identifier rep = getRepresentative();
if (rep.wasAliased)
return;
rep.wasAliased = true;
if (renameRule == Obfuscator.RENAME_UNIQUE) if (renameRule == Obfuscator.RENAME_UNIQUE)
setAlias("xxx" + serialnr++); rep.setAlias("xxx" + serialnr++);
else { else {
StringBuffer newAlias = new StringBuffer(); StringBuffer newAlias = new StringBuffer();
next_alias: next_alias:
@ -194,7 +198,7 @@ public abstract class Identifier {
newAlias.append(renameRule == Obfuscator.RENAME_WEAK newAlias.append(renameRule == Obfuscator.RENAME_WEAK
&& newAlias.length() == 0 ? "A": "0"); && newAlias.length() == 0 ? "A": "0");
} while (false); } while (false);
Identifier ptr = this; Identifier ptr = rep;
while (ptr != null) { while (ptr != null) {
if (ptr.conflicting(newAlias.toString(), if (ptr.conflicting(newAlias.toString(),
renameRule renameRule
@ -202,7 +206,7 @@ public abstract class Identifier {
continue next_alias; continue next_alias;
ptr = ptr.right; ptr = ptr.right;
} }
alias = newAlias.toString(); setAlias(newAlias.toString());
return; return;
} }
} }

Loading…
Cancel
Save