summaryrefslogtreecommitdiff
path: root/src/proguard/classfile/ClassPool.java
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2012-02-27 10:21:35 -0800
committerYing Wang <wangying@google.com>2012-02-27 11:54:51 -0800
commitcfead78069f3dc32998dc118ee08cab3867acea2 (patch)
tree9600f15eed62fa9ba63ce5894d1f09fe686d5997 /src/proguard/classfile/ClassPool.java
parent10aa7224f49abe49d123bde5d34346202d49aaca (diff)
downloadproguard-cfead78069f3dc32998dc118ee08cab3867acea2.tar.gz
Upgrade from Progaurd 4.4 to 4.7.
Change-Id: Ie185d0be411a80cc6a330cafa8547252a7dc1d9c You can find the changelog here http://proguard.sourceforge.net/#downloads.html
Diffstat (limited to 'src/proguard/classfile/ClassPool.java')
-rw-r--r--src/proguard/classfile/ClassPool.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/proguard/classfile/ClassPool.java b/src/proguard/classfile/ClassPool.java
index 57728a5..c5defe8 100644
--- a/src/proguard/classfile/ClassPool.java
+++ b/src/proguard/classfile/ClassPool.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2009 Eric Lafortune (eric@graphics.cornell.edu)
+ * Copyright (c) 2002-2011 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
@@ -26,14 +26,16 @@ import proguard.classfile.visitor.*;
import java.util.*;
/**
- * This is a set of representations of classes. They can be enumerated or
+ * This is a set of representations of classes. They can be enumerated or
* retrieved by name. They can also be accessed by means of class visitors.
*
* @author Eric Lafortune
*/
public class ClassPool
{
- private final Map classes = new HashMap();
+ // We're using a sorted tree map instead of a hash map to store the classes,
+ // in order to make the processing more deterministic.
+ private final Map classes = new TreeMap();
/**
@@ -66,11 +68,11 @@ public class ClassPool
/**
* Returns a Clazz from the class pool based on its name. Returns
* <code>null</code> if the class with the given name is not in the class
- * pool. Returns the base class if the class name is an array type.
+ * pool.
*/
public Clazz getClass(String className)
{
- return (Clazz)classes.get(ClassUtil.internalClassNameFromClassType(className));
+ return (Clazz)classes.get(className);
}
@@ -122,8 +124,11 @@ public class ClassPool
*/
public void classesAcceptAlphabetically(ClassVisitor classVisitor)
{
- TreeMap sortedClasses = new TreeMap(classes);
- Iterator iterator = sortedClasses.values().iterator();
+ // We're already using a tree map.
+ //TreeMap sortedClasses = new TreeMap(classes);
+ //Iterator iterator = sortedClasses.values().iterator();
+
+ Iterator iterator = classes.values().iterator();
while (iterator.hasNext())
{
Clazz clazz = (Clazz)iterator.next();