harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r680600 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/Collections.java test/api/common/org/apache/harmony/luni/tests/java/util/Collections2Test.java
Date Tue, 29 Jul 2008 01:53:57 GMT
Author: qiuxx
Date: Mon Jul 28 18:53:56 2008
New Revision: 680600

URL: http://svn.apache.org/viewvc?rev=680600&view=rev
Log:
Make java.util.Collections.EmptyList implement RandomAccess interface to comply with RI.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/Collections2Test.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java?rev=680600&r1=680599&r2=680600&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
Mon Jul 28 18:53:56 2008
@@ -68,7 +68,7 @@
 
     @SuppressWarnings("unchecked")
     private static final class EmptyList extends AbstractList implements
-            Serializable {
+            RandomAccess, Serializable {
         private static final long serialVersionUID = 8842843931221139166L;
 
         @Override

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/Collections2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/Collections2Test.java?rev=680600&r1=680599&r2=680600&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/Collections2Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/Collections2Test.java
Mon Jul 28 18:53:56 2008
@@ -457,4 +457,11 @@
         c = Collections.checkedSortedMap(c, String.class, String.class);
         SerializationTester.assertCompabilityEquals(c, "serialization/java/util/Collections_CheckedSortedMap.golden.ser");
     }
+    
+    public void test_emptyList(){
+        List<Object> emptyList = Collections.emptyList();
+        assertEquals(0, emptyList.size());
+        assertTrue(emptyList instanceof RandomAccess);
+    }
+
 }



Mime
View raw message