New implementation to get the alias of a class getClassAlias().

PackageIdentifer.findAlias() removed since it was broken.


git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1259 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 25 years ago
parent f0392e9371
commit 356a8c6a61
  1. 9
      jode/jode/obfuscator/ClassBundle.java.in
  2. 15
      jode/jode/obfuscator/PackageIdentifier.java.in

@ -248,6 +248,13 @@ public class ClassBundle implements OptionHandler {
return alias; return alias;
} }
public String getClassAlias(String className) {
ClassIdentifier classIdent = getClassIdentifier(className);
if (classIdent == null)
return className;
return classIdent.getFullAlias();
}
public String getTypeAlias(String typeSig) { public String getTypeAlias(String typeSig) {
String alias = (String) aliasesHash.get(typeSig); String alias = (String) aliasesHash.get(typeSig);
if (alias == null) { if (alias == null) {
@ -256,7 +263,7 @@ public class ClassBundle implements OptionHandler {
while ((nextindex = typeSig.indexOf('L', index)) != -1) { while ((nextindex = typeSig.indexOf('L', index)) != -1) {
newSig.append(typeSig.substring(index, nextindex+1)); newSig.append(typeSig.substring(index, nextindex+1));
index = typeSig.indexOf(';', nextindex); index = typeSig.indexOf(';', nextindex);
String typeAlias = basePackage.findAlias String typeAlias = getClassAlias
(typeSig.substring(nextindex+1, index).replace('/','.')); (typeSig.substring(nextindex+1, index).replace('/','.'));
newSig.append(typeAlias.replace('.', '/')); newSig.append(typeAlias.replace('.', '/'));
} }

@ -310,21 +310,6 @@ public class PackageIdentifier extends Identifier {
return ""; return "";
} }
public String findAlias(String className) {
int index = className.indexOf('.');
if (index == -1) {
Identifier ident = getIdentifier(className);
if (ident != null)
return ident.getFullAlias();
} else {
Identifier pack = getIdentifier(className.substring(0, index));
if (pack != null)
return ((PackageIdentifier)pack)
.findAlias(className.substring(index+1));
}
return className;
}
public void buildTable(Renamer renameRule) { public void buildTable(Renamer renameRule) {
loadOnDemand = false; loadOnDemand = false;
super.buildTable(renameRule); super.buildTable(renameRule);

Loading…
Cancel
Save