Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 17227 invoked from network); 18 Sep 2006 08:50:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Sep 2006 08:50:08 -0000 Received: (qmail 15146 invoked by uid 500); 18 Sep 2006 08:50:08 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 15109 invoked by uid 500); 18 Sep 2006 08:50: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 15097 invoked by uid 99); 18 Sep 2006 08:50:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Sep 2006 01:50: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; Mon, 18 Sep 2006 01:49:49 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DB9AA7142F6 for ; Mon, 18 Sep 2006 08:45:23 +0000 (GMT) Message-ID: <28122832.1158569123896.JavaMail.jira@brutus> Date: Mon, 18 Sep 2006 01:45:23 -0700 (PDT) From: "Anton Luht (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-839) [classlib][util]WeakHashMap(Map arg) throws NPE if arg.entrySet() returns null In-Reply-To: <14492386.1152635369780.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-839?page=comments#action_12435430 ] Anton Luht commented on HARMONY-839: ------------------------------------ the patch applied correctly to svn = r447316 and solved problem with WeakHashMap and IdentityHashMap > [classlib][util]WeakHashMap(Map arg) throws NPE if arg.entrySet() returns null > ------------------------------------------------------------------------------ > > Key: HARMONY-839 > URL: http://issues.apache.org/jira/browse/HARMONY-839 > Project: Harmony > Issue Type: Bug > Components: Classlib > Environment: Windows XP > Reporter: Anton Luht > Assigned To: Paulex Yang > Priority: Trivial > Attachments: harmony-839.diff, identity_hash_map_patch.txt, patch.txt > > > VM + Classlib version 420749 > Problem: > If we create a Map with entrySet() method that return null, WeakHashMap constructor with it won't throw NPE in RI but will in Harmony. > Code to reproduce: > import java.util.*; > public class Test { > public static void main (String[] args) { > Map localMap = new TestMap(); > new WeakHashMap(localMap); > } > } > class TestMap implements Map { > public void clear() { > return; > } > public boolean containsKey(Object p0) { > return false; > } > public boolean containsValue(Object p0) { > return false; > } > public Set entrySet() { > return null; > } > public boolean equals(Object p0) { > return false; > } > public Object get(Object p0) { > return null; > } > public int hashCode() { > return 0; > } > public boolean isEmpty() { > return false; > } > public Set keySet() { > return null; > } > public Object put(Object p0, Object p1) { > return null; > } > public void putAll(Map p0) { > return; > } > public Object remove(Object p0) { > return null; > } > public int size() { > return 0; > } > public Collection values() { > return null; > } > } > Output in RI: none > Output in Harmony: > java.lang.NullPointerException > at java.util.AbstractMap.putAll(AbstractMap.java:282) > at java.util.WeakHashMap.(WeakHashMap.java:231) > at Test.main(Test.java:5) > Please see the unit test for this issue + patch to fix it attached -- 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