From cb5ea77fb4723b28ece00c8c7bbae7c4b2344e59 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 7 Mar 1999 17:14:34 +0000 Subject: [PATCH] bugfix: have to check known sub classes when determining conflict free hood git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@336 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/obfuscator/ClassIdentifier.java | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/jode/jode/obfuscator/ClassIdentifier.java b/jode/jode/obfuscator/ClassIdentifier.java index e355f1f..11add34 100644 --- a/jode/jode/obfuscator/ClassIdentifier.java +++ b/jode/jode/obfuscator/ClassIdentifier.java @@ -465,7 +465,20 @@ public class ClassIdentifier extends Identifier { return false; } + public boolean containsFieldAliasDirectly(String fieldName, + String typeSig) { + for (int i=0; i < fieldCount; i++) { + if ((!Obfuscator.shouldStrip || identifiers[i].isReachable()) + && identifiers[i].getAlias().equals(fieldName) + && identifiers[i].getType().startsWith(typeSig)) + return true; + } + return false; + } + public boolean containFieldAlias(String fieldName, String typeSig) { + if (containsFieldAliasDirectly(fieldName,typeSig)) + return true; for (int i=0; i < fieldCount; i++) { if ((!Obfuscator.shouldStrip || identifiers[i].isReachable()) && identifiers[i].getAlias().equals(fieldName) @@ -527,6 +540,16 @@ public class ClassIdentifier extends Identifier { return null; } + public boolean hasMethod(String methodName, String paramType) { + for (int i=fieldCount; i< identifiers.length; i++) { + if ((!Obfuscator.shouldStrip || identifiers[i].isReachable()) + && identifiers[i].getAlias().equals(methodName) + && identifiers[i].getType().startsWith(paramType)) + return true; + } + return false; + } + public Object getMethod(String methodName, String paramType) { for (int i=fieldCount; i< identifiers.length; i++) { if ((!Obfuscator.shouldStrip || identifiers[i].isReachable()) @@ -534,7 +557,6 @@ public class ClassIdentifier extends Identifier { && identifiers[i].getType().startsWith(paramType)) return identifiers[i]; } - ClassInfo[] ifaces = info.getInterfaces(); for (int i=0; i < ifaces.length; i++) { ClassIdentifier ifaceident = (ClassIdentifier) @@ -571,4 +593,3 @@ public class ClassIdentifier extends Identifier { return pack.contains(newAlias); } } -