You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mark Hindess (JIRA)" <ji...@apache.org> on 2008/04/30 16:45:56 UTC
[jira] Resolved: (HARMONY-5788) [classlib][util]
TreeMap.entrySet().contains() returns true for entries with null value
[ https://issues.apache.org/jira/browse/HARMONY-5788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Hindess resolved HARMONY-5788.
-----------------------------------
Resolution: Fixed
Assignee: Mark Hindess
I think we've eliminated all of the ways we can get this wrong. ;-) So I've committed a solution (and regressions tests for all the ways we got it wrong) in r652391.
> [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
> Assignee: 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.