You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Robert Hu (JIRA)" <ji...@apache.org> on 2007/06/18 08:46:26 UTC

[jira] Created: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6

[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
         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.


[jira] Resolved: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison resolved HARMONY-4203.
----------------------------------

    Resolution: Fixed

Thanks Robert.

Patch applied to LUNI module at repo revision r549073.

Please check it was applied as you expected.


> [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.


[jira] Commented: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6

Posted by "Robert Hu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506049 ] 

Robert Hu commented on HARMONY-4203:
------------------------------------

Tim. I think at least half of this patch is Java 6 specific.
#1 (change of "remove" method) is a different behavior in Java 6, you can also apply this patch into Java 5 trunk and you can see the updated PriorityQueueTest can passes on RI 6 but fails on RI 5. So, it is Java 6 specific.
#2 may be also a feature of Java 5. But according to the spec, there's no doc of methods "contains(Object object),toArray(),toArray(T[] array)" of PriorityQueue in Java 5. In Java 5, these 3 methods are maked as "Methods inherited from sub class XXX". We can see that they're "pulled down" to the class PriorityQueue in Java 6.

So, I think we have two choices now, one is to apply this patch only into Java 6 branch, the other is to split it into 2 patches, one for Java 5 including the 3 inherited methods and one for Java 6 including only the update of "remove" mehtod and related test cases.

Tim, any idea? Thanks a lot!

> [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.


[jira] Assigned: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison reassigned HARMONY-4203:
------------------------------------

    Assignee: Tim Ellison

> [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.


[jira] Commented: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6

Posted by "Robert Hu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506367 ] 

Robert Hu commented on HARMONY-4203:
------------------------------------

No, the changes for PriorityQueue#remove(Object) are NOT applicable for Java 5, it is only for Java 6.
The added test case could show this.
Thanks a lot!

> [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.


[jira] Closed: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6

Posted by "Robert Hu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Hu closed HARMONY-4203.
------------------------------


Verified.
Sorry for the inconvenience caused.
Thanks a lot!

> [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.


[jira] Commented: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505823 ] 

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

Robert, can you confirm that these are Java 6 specific?


> [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.


[jira] Updated: (HARMONY-4203) [classlib][luni][java6] New feature of java.util.PriorityQueue for java6

Posted by "Robert Hu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Hu updated HARMONY-4203:
-------------------------------

    Attachment: HARMONY-4203.diff

Please try this patch.
Thanks a lot!

> [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
>         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.