diff options
author | Ying Wang <wangying@google.com> | 2012-02-27 18:34:24 -0800 |
---|---|---|
committer | Ying Wang <wangying@google.com> | 2012-02-27 18:34:24 -0800 |
commit | 9f606f95f03a75961498803e24bee6799a7c0885 (patch) | |
tree | a45f4d74feda9b76277a0c9ced55ad15d82248a1 /src/proguard/evaluation/value/ReferenceValue.java | |
parent | cfead78069f3dc32998dc118ee08cab3867acea2 (diff) | |
download | android_external_proguard-jellybean.tar.gz android_external_proguard-jellybean.tar.bz2 android_external_proguard-jellybean.zip |
Revert "Upgrade from Progaurd 4.4 to 4.7."cm-10.1.3-RC2cm-10.1.3-RC1cm-10.1.3cm-10.1.2cm-10.1.1cm-10.1.0-RC5cm-10.1.0-RC4cm-10.1.0-RC3cm-10.1.0-RC2cm-10.1.0-RC1cm-10.1.0cm-10.1-M3cm-10.1-M2cm-10.1-M1mr1.1-stagingjellybean-stablejellybeancm-10.1
This reverts commit cfead78069f3dc32998dc118ee08cab3867acea2.
Bug: 6079915
Diffstat (limited to 'src/proguard/evaluation/value/ReferenceValue.java')
-rw-r--r-- | src/proguard/evaluation/value/ReferenceValue.java | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/src/proguard/evaluation/value/ReferenceValue.java b/src/proguard/evaluation/value/ReferenceValue.java index 084a1a4..418c6f8 100644 --- a/src/proguard/evaluation/value/ReferenceValue.java +++ b/src/proguard/evaluation/value/ReferenceValue.java @@ -2,7 +2,7 @@ * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * - * Copyright (c) 2002-2011 Eric Lafortune (eric@graphics.cornell.edu) + * Copyright (c) 2002-2009 Eric Lafortune (eric@graphics.cornell.edu) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -280,25 +280,11 @@ public class ReferenceValue extends Category1Value thisReferencedClass.hierarchyAccept(false, true, true, false, new ClassCollector(thisSuperClasses)); - int thisSuperClassesCount = thisSuperClasses.size(); - if (thisSuperClassesCount == 0 && - thisReferencedClass.getSuperName() != null) - { - throw new IllegalArgumentException("Can't find any super classes of ["+thisType+"] (not even immediate super class ["+thisReferencedClass.getSuperName()+"])"); - } - // Collect the superclasses and interfaces of the other class. Set otherSuperClasses = new HashSet(); otherReferencedClass.hierarchyAccept(false, true, true, false, new ClassCollector(otherSuperClasses)); - int otherSuperClassesCount = otherSuperClasses.size(); - if (otherSuperClassesCount == 0 && - otherReferencedClass.getSuperName() != null) - { - throw new IllegalArgumentException("Can't find any super classes of ["+otherType+"] (not even immediate super class ["+otherReferencedClass.getSuperName()+"])"); - } - if (DEBUG) { System.out.println("ReferenceValue.generalize this ["+thisReferencedClass.getName()+"] with other ["+otherReferencedClass.getName()+"]"); @@ -316,7 +302,7 @@ public class ReferenceValue extends Category1Value // Find a class that is a subclass of all common superclasses, // or that at least has the maximum number of common superclasses. - Clazz commonClass = null; + Clazz commonClazz = null; int maximumSuperClassCount = -1; @@ -331,33 +317,31 @@ public class ReferenceValue extends Category1Value int superClassCount = superClassCount(commonSuperClass, thisSuperClasses); if (maximumSuperClassCount < superClassCount || (maximumSuperClassCount == superClassCount && - commonClass != null && - commonClass.getName().compareTo(commonSuperClass.getName()) > 0)) + commonClazz != null && + commonClazz.getName().compareTo(commonSuperClass.getName()) > 0)) { - commonClass = commonSuperClass; + commonClazz = commonSuperClass; maximumSuperClassCount = superClassCount; } } - if (commonClass == null) + if (commonClazz == null) { - throw new IllegalArgumentException("Can't find common super class of ["+ - thisType +"] (with "+thisSuperClassesCount +" known super classes) and ["+ - otherType+"] (with "+otherSuperClassesCount+" known super classes)"); + throw new IllegalArgumentException("Can't find common super class of ["+thisType+"] and ["+otherType+"]"); } if (DEBUG) { - System.out.println(" Best common class: ["+commonClass.getName()+"]"); + System.out.println(" Best common class: ["+commonClazz.getName()+"]"); } // TODO: Handle more difficult cases, with multiple global subclasses. return new ReferenceValue(commonDimensionCount == 0 ? - commonClass.getName() : - ClassUtil.internalArrayTypeFromClassName(commonClass.getName(), + commonClazz.getName() : + ClassUtil.internalArrayTypeFromClassName(commonClazz.getName(), commonDimensionCount), - commonClass, + commonClazz, mayBeNull); } } @@ -418,6 +402,8 @@ public class ReferenceValue extends Category1Value } } + //System.out.println("ReferenceValue.superClassCount: ["+subClass.getName()+"]: "+count); + return count; } |