harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6
Date Tue, 19 Jun 2007 13:59:26 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506174
] 

Tim Ellison commented on HARMONY-4203:
--------------------------------------

Sorry for being unclear.

I was wondering specifically if the changes you propose for  PriorityQueue#remove(Object)
 are also applicable for Java 5?  It looks like it to me.

 i.e.

@@ -230,17 +231,13 @@
         if (o == null) {
             return false;
         }
-        int targetIndex;
-        for (targetIndex = 0; targetIndex < size; targetIndex++) {
-            if (0 == this.compare((E) o, elements[targetIndex])) {
-                break;
+        for (int i = 0; i < size; i++) {
+            if (elements[i].equals(o)) {
+                removeAt(i);
+                return true;
             }
         }
-        if (size == 0 || size == targetIndex) {
-            return false;
-        }
-        removeAt(targetIndex);
-        return true;
+        return false;
     }
 

> [classlib][luni][java6] New feature of java.util.PriorityQueue for java6
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-4203
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4203
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>            Reporter: Robert Hu
>            Assignee: Tim Ellison
>         Attachments: HARMONY-4203.diff
>
>
> I've added the new feature of java.util.PriorityQueue for java6:
> 1. the behavior of remove method is changed, and some relative test cases is added
> 2. some methods in "java.util.AbstractCollection" of java5 are moved into java.util.PriorityQueue
(push down) of java6, also with some relative test cases:
>           public boolean contains(Object object)
>           public Object[] toArray()
>           public <T> T[] toArray(T[] array)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message