harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5788) [classlib][util] TreeMap.entrySet().contains() returns true for entries with null value
Date Fri, 25 Apr 2008 20:23:56 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-5788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592491#action_12592491
] 

Mark Hindess commented on HARMONY-5788:
---------------------------------------

Jimmy, Thanks for looking at this but I think your solution breaks a containsAll test for
entrySets of two identical maps.  For example, append the following to the end of the above
main method:

        map.put("one", "1");
        map.put("null", null);
        System.out.println("containsAll? == " +
                           map.entrySet().containsAll(master.entrySet()));

On Harmony trunk without this change (and on RI) you get:

  containsAll? == true

but on Harmony with the change you get:

  containsAll? == false


> [classlib][util] TreeMap.entrySet().contains() returns true for entries with null value
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5788
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5788
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Mark Hindess
>
> The following code illustrates the problem:
> import java.util.TreeMap;
> public class TestTreeMap {
>     public static void main(String[] args) {
>         TreeMap master = new TreeMap<String, String>();
>         master.put("one", "1");
>         master.put("null", null);
>         TreeMap map = new TreeMap<String, String>();
>         Object[] element = master.entrySet().toArray();
>         for (int i = 0; i < element.length ; i++) {
>             System.out.println("Contains entry " + element[i] + "? == " +
>                                map.entrySet().contains(element[i]));
>         }
>     }
> }
> On harmony, the output is:
>   Contains entry null=null? == true
>   Contains entry one=1? == false
> on the RI, the output is:
>   Contains entry null=null? == false
>   Contains entry one=1? == false

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