harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r411654 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/Collections.java test/java/tests/api/java/util/CollectionsTest.java
Date Mon, 05 Jun 2006 04:07:12 GMT
Author: mloenko
Date: Sun Jun  4 21:07:11 2006
New Revision: 411654

URL: http://svn.apache.org/viewvc?rev=411654&view=rev
Log:
fixes for HARMONY-552
unmodifiableCollections missing toString methods

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java?rev=411654&r1=411653&r2=411654&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
Sun Jun  4 21:07:11 2006
@@ -909,8 +909,12 @@
 		}
 
 		public Object[] toArray(Object[] array) {
-			return c.toArray(array);
-		}
+            return c.toArray(array);
+        }
+
+        public String toString() {
+            return c.toString();
+        }
 	}
 
 	private static class UnmodifiableRandomAccessList extends UnmodifiableList
@@ -1205,6 +1209,10 @@
 		public Collection values() {
 			return new UnmodifiableCollection(m.values());
 		}
+
+                public String toString() {
+                        return m.toString();
+                }
 	}
 
 	private static class UnmodifiableSet extends UnmodifiableCollection

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java?rev=411654&r1=411653&r2=411654&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java
Sun Jun  4 21:07:11 2006
@@ -1875,9 +1875,26 @@
 	}
 
 	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
+     * Test unmodifiable objects toString methods
+     */
+    public void test_unmodifiable_toString_methods() {
+        // Regression for HARMONY-552
+        ArrayList al = new ArrayList();
+        al.add("a");
+        al.add("b");
+        Collection uc = Collections.unmodifiableCollection(al);
+        assertEquals("[a, b]", uc.toString());
+        HashMap m = new HashMap();
+        m.put("one", "1");
+        m.put("two", "2");
+        Map um = Collections.unmodifiableMap(m);
+        assertEquals("{one=1, two=2}", um.toString());
+    }
+
+    /**
+     * Sets up the fixture, for example, open a network connection. This method
+     * is called before a test is executed.
+     */
 	protected void setUp() {
 		ll = new LinkedList();
 		myll = new LinkedList();



Mime
View raw message