getChilds() method added

handle build/write/readTable


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1012 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 2a94fad7c8
commit 8560daa7e3
  1. 15
      jode/jode/obfuscator/Identifier.java

@ -171,10 +171,15 @@ public abstract class Identifier {
static int serialnr = 0; static int serialnr = 0;
public void buildTable(Renamer renameRule) { public void buildTable(Renamer renameRule) {
if (!isReachable()
&& (Main.stripping & Main.STRIP_UNREACH) != 0)
return;
if (isPreserved()) { if (isPreserved()) {
if (GlobalOptions.verboseLevel > 4) if (GlobalOptions.verboseLevel > 4)
GlobalOptions.err.println(toString() + " is preserved"); GlobalOptions.err.println(toString() + " is preserved");
} else { } else {
Identifier rep = getRepresentative(); Identifier rep = getRepresentative();
if (rep.wasAliased) if (rep.wasAliased)
return; return;
@ -196,10 +201,18 @@ public abstract class Identifier {
return; return;
} }
} }
for (Iterator i = getChilds(); i.hasNext(); )
((Identifier)i.next()).buildTable(renameRule);
} }
public void writeTable(Map table) { public void writeTable(Map table) {
if (!isReachable()
&& (Main.stripping & Main.STRIP_UNREACH) != 0)
return;
table.put(getFullAlias(), getName()); table.put(getFullAlias(), getName());
for (Iterator i = getChilds(); i.hasNext(); )
((Identifier)i.next()).writeTable(table);
} }
public void readTable(Map table) { public void readTable(Map table) {
@ -211,6 +224,8 @@ public abstract class Identifier {
rep.setAlias(newAlias); rep.setAlias(newAlias);
} }
} }
for (Iterator i = getChilds(); i.hasNext(); )
((Identifier)i.next()).readTable(table);
} }
public void applyPreserveRule(IdentifierMatcher preserveRule) { public void applyPreserveRule(IdentifierMatcher preserveRule) {

Loading…
Cancel
Save