harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r635551 - in /harmony/enhanced/classlib/trunk/modules/pack200/src: main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java
Date Mon, 10 Mar 2008 13:17:59 GMT
Author: sjanuary
Date: Mon Mar 10 06:17:58 2008
New Revision: 635551

URL: http://svn.apache.org/viewvc?rev=635551&view=rev
Log:
Apply patches for HARMONY-5585 ([classlib][pack200] regression: inner classes no longer computed
correctly)

Modified:
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java?rev=635551&r1=635550&r2=635551&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ClassConstantPool.java
Mon Mar 10 06:17:58 2008
@@ -180,9 +180,12 @@
      */
     public List allClasses() {
         List classesList = new ArrayList();
-        Iterator it = classPoolSet.partialIterator(DOMAIN_CLASSREF, DOMAIN_CLASSREF);
+        Iterator it = entries.iterator();
         while(it.hasNext()) {
-            classesList.add(it.next());
+            ConstantPoolEntry entry = (ConstantPoolEntry)it.next();
+            if(entry.getDomain() == DOMAIN_CLASSREF) {
+                classesList.add(entry);
+            }
         }
         return classesList;
     }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java?rev=635551&r1=635550&r2=635551&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java
Mon Mar 10 06:17:58 2008
@@ -18,7 +18,7 @@
 
 import junit.framework.TestCase;
 
-import org.apache.harmony.pack200.CpBands;
+import org.apache.harmony.pack200.bytecode.CPClass;
 import org.apache.harmony.pack200.bytecode.CPMember;
 import org.apache.harmony.pack200.bytecode.CPUTF8;
 import org.apache.harmony.pack200.bytecode.ClassConstantPool;
@@ -50,5 +50,11 @@
 		pool.add(u1);
 		pool.resolve();
 		assertTrue(pool.indexOf(u1) > 0);
+	}
+	
+	public void testAllClasses() {
+	    pool.add(new CPClass(new CPUTF8("RandomClass", ClassConstantPool.DOMAIN_NORMALASCIIZ)));
+        pool.add(new CPClass(new CPUTF8("RandomClass2", ClassConstantPool.DOMAIN_NORMALASCIIZ)));
+	    assertEquals(2, pool.allClasses().size());
 	}
 }



Mime
View raw message