Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 79673 invoked from network); 2 Aug 2006 03:16:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2006 03:16:09 -0000 Received: (qmail 9345 invoked by uid 500); 2 Aug 2006 03:16:08 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 9280 invoked by uid 500); 2 Aug 2006 03:16:08 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 9250 invoked by uid 99); 2 Aug 2006 03:16:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 20:16:08 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 20:16:07 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 399FF410028 for ; Wed, 2 Aug 2006 03:13:25 +0000 (GMT) Message-ID: <31849936.1154488405233.JavaMail.jira@brutus> Date: Tue, 1 Aug 2006 20:13:25 -0700 (PDT) From: "Paulex Yang (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Assigned: (HARMONY-1026) [classlib][luni] java.util.TreeMap.headMap(Object) method does not return empty SortedMap In-Reply-To: <31689172.1154420833928.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-1026?page=all ] Paulex Yang reassigned HARMONY-1026: ------------------------------------ Assignee: Paulex Yang > [classlib][luni] java.util.TreeMap.headMap(Object) method does not return empty SortedMap > ----------------------------------------------------------------------------------------- > > Key: HARMONY-1026 > URL: http://issues.apache.org/jira/browse/HARMONY-1026 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: spark shen > Assigned To: Paulex Yang > Attachments: harmony-1026.diff > > > java.util.TreeMap.headMap(Object) method does not return > empty SortedMap when the specified object is null and the tree map uses a > null-tolerable comparator. > The following test case gives a hint. > public static class MockComparator implements Comparator { > > public int compare(T o1, T o2) { > if(null == o1) return -1; > if(o1.equals(o2)) { > return 0; > } > return 1; > } > > } > public void test_headMapLjava_lang_Object() { > TreeMap map = new TreeMap( > new MockComparator()); > map.put(1, 2.1); > map.put(2, 3.1); > map.put(3, 4.5); > map.put(7, 21.3); > SortedMap smap = map.headMap(null); > assertEquals(0, smap.size()); > Set keySet = smap.keySet(); > assertEquals(0, keySet.size()); > Set> entrySet = smap.entrySet(); > assertEquals(0, entrySet.size()); > } > I will attach a patch to fix this problem. > Best regards, > Spark Shen -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira