diff --git a/jode/jode/obfuscator/MethodIdentifier.java b/jode/jode/obfuscator/MethodIdentifier.java index 96fb20d..64b009e 100644 --- a/jode/jode/obfuscator/MethodIdentifier.java +++ b/jode/jode/obfuscator/MethodIdentifier.java @@ -33,57 +33,19 @@ import java.util.Hashtable; public class MethodIdentifier extends Identifier implements Opcodes { ClassIdentifier clazz; MethodInfo info; - /** - * The exceptions that can be thrown by this method - */ - String[] exceptions; ///#ifdef JDK12 /// /** -/// * The byte code for this method, or null if there isn't any. -/// */ -/// SoftReference byteCodeRef; -/// /** /// * The code analyzer of this method, or null if there isn't any. /// */ /// SoftReference codeAnalyzerRef; ///#else - /** - * The byte code for this method, or null if there isn't any. - */ - BytecodeInfo byteCode; /** * The code analyzer of this method, or null if there isn't any. */ CodeAnalyzer codeAnalyzer; ///#endif - public BytecodeInfo getBytecode() { -///#ifdef JDK12 -/// if (byteCodeRef != null && byteCodeRef.get() != null) -/// return (BytecodeInfo) byteCodeRef.get(); -/// BytecodeInfo byteCode = null; -///#else - if (byteCode != null) - return byteCode; -///#endif - AttributeInfo codeattr = info.findAttribute("Code"); - try { - if (codeattr != null) { - DataInputStream stream = new DataInputStream - (new ByteArrayInputStream(codeattr.getContents())); - byteCode = new BytecodeInfo(); - byteCode.read(clazz.info.getConstantPool(), stream); -///#ifdef JDK12 -/// byteCodeRef = new SoftReference(byteCode); -///#endif - } - } catch (IOException ex) { - ex.printStackTrace(Obfuscator.err); - } - return byteCode; - } - public CodeAnalyzer getCodeAnalyzer() { ///#ifdef JDK12 /// if (codeAnalyzerRef != null && codeAnalyzerRef.get() != null) @@ -94,7 +56,7 @@ public class MethodIdentifier extends Identifier implements Opcodes { return codeAnalyzer; ///#endif - BytecodeInfo code = getBytecode(); + BytecodeInfo code = info.getBytecode(); if (code != null) { codeAnalyzer = new ConstantAnalyzer(code, this); ///#ifdef JDK12 @@ -108,13 +70,6 @@ public class MethodIdentifier extends Identifier implements Opcodes { super(info.getName()); this.clazz = clazz; this.info = info; - AttributeInfo exceptionsattr = info.findAttribute("Exceptions"); - try { - if (exceptionsattr != null) - readExceptions(exceptionsattr); - } catch (IOException ex) { - ex.printStackTrace(Obfuscator.err); - } } public void applyPreserveRule(int preserveRule) { @@ -124,21 +79,6 @@ public class MethodIdentifier extends Identifier implements Opcodes { } } - public void readExceptions(AttributeInfo exceptionsattr) - throws IOException { - byte[] content = exceptionsattr.getContents(); - DataInputStream input = new DataInputStream - (new ByteArrayInputStream(content)); - ConstantPool cp = clazz.info.getConstantPool(); - - int count = input.readUnsignedShort(); - exceptions = new String[count]; - for (int i=0; i< count; i++) { - exceptions[i] - = cp.getClassName(input.readUnsignedShort()).replace('/','.'); - } - } - public void setSingleReachable() { super.setSingleReachable(); clazz.bundle.analyzeIdentifier(this); @@ -157,6 +97,7 @@ public class MethodIdentifier extends Identifier implements Opcodes { index = type.indexOf('L', end); } + String[] exceptions = info.getExceptions(); if (exceptions != null) { for (int i=0; i< exceptions.length; i++) clazz.bundle.reachableIdentifier(exceptions[i], false); @@ -192,7 +133,7 @@ public class MethodIdentifier extends Identifier implements Opcodes { } public String getType() { - return info.getType().getTypeSignature(); + return info.getType(); } public boolean conflicting(String newAlias, boolean strong) { @@ -216,15 +157,6 @@ public class MethodIdentifier extends Identifier implements Opcodes { return "MethodIdentifier "+getFullName()+"."+getType(); } - - int nameIndex; - int descriptorIndex; - int codeIndex; - BytecodeInfo strippedBytecode; - byte[] code; - int exceptionsIndex; - int[] excIndices; - /** * This method does the code transformation. This include *