summaryrefslogtreecommitdiff
path: root/src/proguard/classfile/ClassPool.java
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2012-02-27 18:34:24 -0800
committerYing Wang <wangying@google.com>2012-02-27 18:34:24 -0800
commit9f606f95f03a75961498803e24bee6799a7c0885 (patch)
treea45f4d74feda9b76277a0c9ced55ad15d82248a1 /src/proguard/classfile/ClassPool.java
parentcfead78069f3dc32998dc118ee08cab3867acea2 (diff)
downloadproguard-9f606f95f03a75961498803e24bee6799a7c0885.tar.gz
This reverts commit cfead78069f3dc32998dc118ee08cab3867acea2. Bug: 6079915
Diffstat (limited to 'src/proguard/classfile/ClassPool.java')
-rw-r--r--src/proguard/classfile/ClassPool.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/proguard/classfile/ClassPool.java b/src/proguard/classfile/ClassPool.java
index c5defe8..57728a5 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-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
@@ -26,16 +26,14 @@ 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
{
- // 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();
+ private final Map classes = new HashMap();
/**
@@ -68,11 +66,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.
+ * pool. Returns the base class if the class name is an array type.
*/
public Clazz getClass(String className)
{
- return (Clazz)classes.get(className);
+ return (Clazz)classes.get(ClassUtil.internalClassNameFromClassType(className));
}
@@ -124,11 +122,8 @@ public class ClassPool
*/
public void classesAcceptAlphabetically(ClassVisitor classVisitor)
{
- // We're already using a tree map.
- //TreeMap sortedClasses = new TreeMap(classes);
- //Iterator iterator = sortedClasses.values().iterator();
-
- Iterator iterator = classes.values().iterator();
+ TreeMap sortedClasses = new TreeMap(classes);
+ Iterator iterator = sortedClasses.values().iterator();
while (iterator.hasNext())
{
Clazz clazz = (Clazz)iterator.next();