diff --git a/jode/jode/obfuscator/FieldIdentifier.java b/jode/jode/obfuscator/FieldIdentifier.java index 6ec7fbb..b2e15b7 100644 --- a/jode/jode/obfuscator/FieldIdentifier.java +++ b/jode/jode/obfuscator/FieldIdentifier.java @@ -20,7 +20,7 @@ package jode.obfuscator; import java.lang.reflect.Modifier; import jode.bytecode.*; import java.io.*; -import java.util.Hashtable; +import java.util.*; public class FieldIdentifier extends Identifier{ FieldInfo info; @@ -88,11 +88,17 @@ public class FieldIdentifier extends Identifier{ } public boolean conflicting(String newAlias, boolean strong) { - if (strong) { - return clazz.containFieldAlias(newAlias, getType()); - } else { - return clazz.containFieldAlias(newAlias, ""); + String typeSig = strong ? getType() : ""; + if (clazz.containFieldAlias(newAlias, typeSig)) + return true; + + Enumeration enum = clazz.knownSubClasses.elements(); + while (enum.hasMoreElements()) { + ClassIdentifier ci = (ClassIdentifier) enum.nextElement(); + if (ci.containsFieldAliasDirectly(newAlias, typeSig)) + return true; } + return false; } int nameIndex; diff --git a/jode/jode/obfuscator/MethodIdentifier.java b/jode/jode/obfuscator/MethodIdentifier.java index 6b43d2e..704adba 100644 --- a/jode/jode/obfuscator/MethodIdentifier.java +++ b/jode/jode/obfuscator/MethodIdentifier.java @@ -282,13 +282,20 @@ public class MethodIdentifier extends Identifier implements Opcodes { } public boolean conflicting(String newAlias, boolean strong) { - if (strong) { - return clazz.getMethod(newAlias, getType()) != null; - } else { - String type = getType(); - String paramType = type.substring(0, type.indexOf(')')+1); - return clazz.getMethod(newAlias, paramType) != null; + String paramType = getType(); + if (!strong) { + paramType = paramType.substring(0, paramType.indexOf(')')+1); } + if (clazz.getMethod(newAlias, paramType) != null) + return true; + + Enumeration enum = clazz.knownSubClasses.elements(); + while (enum.hasMoreElements()) { + ClassIdentifier ci = (ClassIdentifier) enum.nextElement(); + if (ci.hasMethod(newAlias, paramType)) + return true; + } + return false; } public String toString() {