harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Markov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2474) [classlib][luni] java.util.TreeSet.remove() throw ClassCastException while trying to remove element from empty TreeSet
Date Wed, 21 Mar 2007 18:22:32 GMT

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

Mikhail Markov commented on HARMONY-2474:
-----------------------------------------

Thanks, Alexey! The issue is resolved now.

> [classlib][luni] java.util.TreeSet.remove() throw ClassCastException while trying to
remove element from empty TreeSet
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2474
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2474
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Anton Ivanov
>         Assigned To: Alexey Petrenko
>            Priority: Minor
>         Attachments: H-2474.patch
>
>
> While trying to remove element from empty TreeSet, ClassCastException is thrown.
> Test to reproduce the problem:
> import java.util.TreeSet;
> public class EmptyTreeRemoveTest {
>     public static void main(String[] args) {
>         TreeSet ts = new TreeSet();
>         Object node = new Object();
>         
>         try {
>             ts.remove(node);
>             System.out.println("PASSED");
>         } catch (Exception e) {
>             System.out.println("FAILED");
>             e.printStackTrace();
>         }
>     }
> }
> Output on Harmony:
> FAILED
> java.lang.ClassCastException: java.lang.Object incompatible with java.lang.Comparable
>         at java.util.TreeMap.toComparable(TreeMap.java:79)
>         at java.util.TreeMap.find(TreeMap.java:98)
>         at java.util.TreeMap.remove(TreeMap.java:1322)
>         at java.util.TreeSet.remove(TreeSet.java:290)
>         at TreeRemoveTest.main(TreeRemoveTest.java:10)
> Output on RI:
> PASSED

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