Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 32710 invoked from network); 17 Jul 2006 14:43:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jul 2006 14:43:22 -0000 Received: (qmail 30388 invoked by uid 500); 17 Jul 2006 14:43:22 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 30347 invoked by uid 500); 17 Jul 2006 14:43:22 -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 30336 invoked by uid 99); 17 Jul 2006 14:43:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jul 2006 07:43:21 -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, 17 Jul 2006 07:43:21 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B2ACC41001A for ; Mon, 17 Jul 2006 14:41:14 +0000 (GMT) Message-ID: <25561591.1153147274728.JavaMail.jira@brutus> Date: Mon, 17 Jul 2006 07:41:14 -0700 (PDT) From: "Anton Luht (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Updated: (HARMONY-839) 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=all ] Anton Luht updated HARMONY-839: ------------------------------- Attachment: identity_hash_map_patch.txt same problem with IdentityHashMap - attaching patch with JUnit test and fix for classlib code > 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: Non-bug differences from RI > Environment: Windows XP > Reporter: Anton Luht > Priority: Trivial > Attachments: 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