getIdentifier(Reference) added

getIdentifier(String) renamed to getClassIdentifier


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@581 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 5c6b8a7eb5
commit bf7761c6a1
  1. 18
      jode/jode/obfuscator/ClassBundle.java

@ -20,6 +20,7 @@
package jode.obfuscator; package jode.obfuscator;
import jode.Obfuscator; import jode.Obfuscator;
import jode.bytecode.ClassInfo; import jode.bytecode.ClassInfo;
import jode.bytecode.Reference;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
@ -56,8 +57,21 @@ public class ClassBundle {
return newSig.append(typeSig.substring(index)).toString(); return newSig.append(typeSig.substring(index)).toString();
} }
public Identifier getIdentifier(String name) { public ClassIdentifier getClassIdentifier(String name) {
return basePackage.getIdentifier(name); return (ClassIdentifier) basePackage.getIdentifier(name);
}
public Identifier getIdentifier(Reference ref) {
String clName = ref.getClazz();
if (clName.charAt(0) == '[')
/* Can't represent arrays */
return null;
ClassIdentifier ident =
getClassIdentifier(clName.substring(1, clName.length()-1)
.replace('/','.'));
if (ident == null)
return null;
return ident.getIdentifier(ref.getName(), ref.getType());
} }
public void loadClasses(String packageOrClass) { public void loadClasses(String packageOrClass) {

Loading…
Cancel
Save