harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r967015 - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/libs/ classlib/modules/luni/src/main/java/java/util/ classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ drlvm/ jdktools/
Date Fri, 23 Jul 2010 09:39:38 GMT
Author: tellison
Date: Fri Jul 23 09:39:38 2010
New Revision: 967015

URL: http://svn.apache.org/viewvc?rev=967015&view=rev
Log:
Merge conflicted changes from trunk@966935

Modified:
    harmony/enhanced/java/branches/java6/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/depends/libs/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/PriorityQueue.java
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/PriorityQueueTest.java
    harmony/enhanced/java/branches/java6/drlvm/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/   (props changed)

Propchange: harmony/enhanced/java/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 09:39:38 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh:935751-941490
-/harmony/enhanced/java/trunk:929253-966188,966504,966571,966935
+/harmony/enhanced/java/trunk:929253-966504,966571,966935
 /harmony/enhanced/trunk:476395-929252
 /incubator/harmony/enhanced/trunk:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 09:39:38 2010
@@ -1,7 +1,7 @@
 /harmony/enhanced/classlib/trunk:713674-735919,765923-926091,926318-926838
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286
 /harmony/enhanced/java/branches/mrh/classlib:935751-941490
-/harmony/enhanced/java/trunk/classlib:929253-966188,966504,966571,966935
+/harmony/enhanced/java/trunk/classlib:929253-966504,966571,966935
 /harmony/enhanced/trunk/classlib:476395-929252
 /harmony/enhanced/trunk/working_classlib:476396-920147
 /incubator/harmony/enhanced/trunk/classlib:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/depends/libs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 09:39:38 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/classlib/trunk/depends/libs:544451-926091
-/harmony/enhanced/java/trunk/classlib/depends/libs:929253-966188,966504,966571,966935
+/harmony/enhanced/java/trunk/classlib/depends/libs:929253-966504,966571,966935
 /harmony/enhanced/trunk/classlib/depends/libs:476395-929252
 /incubator/harmony/enhanced/trunk/classlib/depends/libs:292550-476394

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/PriorityQueue.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/PriorityQueue.java?rev=967015&r1=967014&r2=967015&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/PriorityQueue.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/java/java/util/PriorityQueue.java
Fri Jul 23 09:39:38 2010
@@ -240,13 +240,12 @@ public class PriorityQueue<E> extends Ab
      *         was not in the priority queue.
      */
     @Override
-    @SuppressWarnings("unchecked")
     public boolean remove(Object o) {
-        if (o == null) {
+        if (o == null || size == 0) {
             return false;
         }
         for (int i = 0; i < size; i++) {
-            if (elements[i].equals(o)) {
+            if (o.equals(elements[i])) {
                 removeAt(i);
                 return true;
             }

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/PriorityQueueTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/PriorityQueueTest.java?rev=967015&r1=967014&r2=967015&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/PriorityQueueTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/PriorityQueueTest.java
Fri Jul 23 09:39:38 2010
@@ -132,7 +132,18 @@ public class PriorityQueueTest extends T
         for (int i = 0; i < integerQueue.size(); i++) {
             assertEquals(newArray[i], integerQueue.poll());
         }
+    }
 
+    public void test_iterator_removeEquals() {
+        PriorityQueue<String> integerQueue = new PriorityQueue<String>(10, new
MockComparatorStringByLength());
+        String[] array = { "ONE", "TWO", "THREE", "FOUR", "FIVE" };
+        for (int i = 0; i < array.length; i++) {
+            integerQueue.offer(array[i]);
+        }
+        // Try removing an entry that the comparator says is equal
+        assertFalse(integerQueue.remove("123"));
+        assertFalse(integerQueue.remove("one"));
+        assertTrue(integerQueue.remove("THREE"));
     }
 
     /**
@@ -593,7 +604,7 @@ public class PriorityQueueTest extends T
             queue.offer(array[i]);
         }
         assertFalse(queue.contains("BB"));
-        assertFalse(queue.remove("BB"));
+        assertTrue(queue.remove("AA"));
     }
 
     /**
@@ -629,7 +640,7 @@ public class PriorityQueueTest extends T
         List<Integer> list = Arrays.asList(array);
         PriorityQueue<Integer> integerQueue = new PriorityQueue<Integer>(list);
         assertFalse(integerQueue.remove(new Float(1.3F)));
-
+ 
         // although argument element type is not compatible with those in queue,
         // but comparator supports it.
         MockComparator<Object> comparator = new MockComparator<Object>();

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 09:39:38 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-966188,966504,966571,966935
+/harmony/enhanced/java/trunk/drlvm:929253-966504,966571,966935
 /harmony/enhanced/trunk/drlvm:476395-929252
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/drlvm:292550-476394

Propchange: harmony/enhanced/java/branches/java6/jdktools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 09:39:38 2010
@@ -1,4 +1,4 @@
-/harmony/enhanced/java/trunk/jdktools:929253-966188,966504,966571,966935
+/harmony/enhanced/java/trunk/jdktools:929253-966504,966571,966935
 /harmony/enhanced/jdktools/trunk:630107-925933
 /harmony/enhanced/trunk/jdktools:476395-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147



Mime
View raw message