You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2007/03/20 15:47:32 UTC

[jira] Assigned: (HARMONY-2474) [classlib][luni] java.util.TreeSet.remove() throw ClassCastException while trying to remove element from empty TreeSet

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

Alexey Petrenko reassigned HARMONY-2474:
----------------------------------------

    Assignee: Alexey Petrenko

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