harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao Shu (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6603) [classlib][luni] org.apache.harmony.luni.internal.net.www.protocol.http.Header could not tolerate null key
Date Tue, 27 Jul 2010 07:13:16 GMT

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

Xiao Shu commented on HARMONY-6603:
-----------------------------------

using 
new Comparator<String>() {
                    public int compare(String o1, String o2) {
                        if (o1 == null && o2 == null) {
                            return 0;
                        }
                        if (o1 == null) {
                            return Integer.MIN_VALUE;
                        }
                        if (o2 == null) {
                            return Integer.MAX_VALUE;
                        }
                        return o1.hashCode() - o2.hashCode();
                    }
                }
instead of String.CASE_INSENSITIVE_ORDER comparator.

Thus it could tolerate null key, the key ordering is the same as HashMap.
and it would not break fix for https://issues.apache.org/jira/browse/HARMONY-6452

> [classlib][luni] org.apache.harmony.luni.internal.net.www.protocol.http.Header could
not tolerate null key
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6603
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6603
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M14
>            Reporter: Xiao Shu
>
> TreeMap(String.CASE_INSENSITIVE_ORDER) could not tolerate null key, but key for staus
line is null.
> Thus, NullPointerException occurs while initializing the Header with a map contains null
status line key.

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