OSDN Git Service

Fix a broken test.
authorElliott Hughes <enh@google.com>
Tue, 5 Jan 2010 01:15:49 +0000 (17:15 -0800)
committerElliott Hughes <enh@google.com>
Tue, 5 Jan 2010 01:15:49 +0000 (17:15 -0800)
This test assumed Integer.toString has no caching.

libcore/luni/src/test/java/tests/api/java/util/IdentityHashMapTest.java

index 0143479..dec82fd 100644 (file)
@@ -582,7 +582,8 @@ public class IdentityHashMapTest extends junit.framework.TestCase {
         objArray2 = new Object[hmSize];
         for (int i = 0; i < objArray.length; i++) {
             objArray[i] = new Integer(i);
-            objArray2[i] = objArray[i].toString();
+            // android-changed: the containsKey test requires unique strings.
+            objArray2[i] = new String(objArray[i].toString());
         }
 
         hm = new IdentityHashMap();