have to check known sub classes when determining conflict free hood

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@338 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent d2e21dcf59
commit 8a4b992d2a
  1. 16
      jode/jode/obfuscator/FieldIdentifier.java
  2. 19
      jode/jode/obfuscator/MethodIdentifier.java

@ -20,7 +20,7 @@ package jode.obfuscator;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import jode.bytecode.*; import jode.bytecode.*;
import java.io.*; import java.io.*;
import java.util.Hashtable; import java.util.*;
public class FieldIdentifier extends Identifier{ public class FieldIdentifier extends Identifier{
FieldInfo info; FieldInfo info;
@ -88,11 +88,17 @@ public class FieldIdentifier extends Identifier{
} }
public boolean conflicting(String newAlias, boolean strong) { public boolean conflicting(String newAlias, boolean strong) {
if (strong) { String typeSig = strong ? getType() : "";
return clazz.containFieldAlias(newAlias, getType()); if (clazz.containFieldAlias(newAlias, typeSig))
} else { return true;
return clazz.containFieldAlias(newAlias, "");
Enumeration enum = clazz.knownSubClasses.elements();
while (enum.hasMoreElements()) {
ClassIdentifier ci = (ClassIdentifier) enum.nextElement();
if (ci.containsFieldAliasDirectly(newAlias, typeSig))
return true;
} }
return false;
} }
int nameIndex; int nameIndex;

@ -282,13 +282,20 @@ public class MethodIdentifier extends Identifier implements Opcodes {
} }
public boolean conflicting(String newAlias, boolean strong) { public boolean conflicting(String newAlias, boolean strong) {
if (strong) { String paramType = getType();
return clazz.getMethod(newAlias, getType()) != null; if (!strong) {
} else { paramType = paramType.substring(0, paramType.indexOf(')')+1);
String type = getType();
String paramType = type.substring(0, type.indexOf(')')+1);
return clazz.getMethod(newAlias, paramType) != null;
} }
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() { public String toString() {

Loading…
Cancel
Save