Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 65399 invoked from network); 22 Sep 2006 07:19:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Sep 2006 07:19:20 -0000 Received: (qmail 62261 invoked by uid 500); 22 Sep 2006 07:19:16 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 62235 invoked by uid 500); 22 Sep 2006 07:19:16 -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 62220 invoked by uid 99); 22 Sep 2006 07:19:16 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Sep 2006 00:19:16 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:47934] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id A7/4F-06791-C6E83154 for ; Fri, 22 Sep 2006 00:19:09 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C6B1D7142FE for ; Fri, 22 Sep 2006 07:15:25 +0000 (GMT) Message-ID: <33235939.1158909325811.JavaMail.jira@brutus> Date: Fri, 22 Sep 2006 00:15:25 -0700 (PDT) From: "Paulex Yang (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Closed: (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-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-839?page=all ] Paulex Yang closed HARMONY-839. ------------------------------- Verified by Anton and Spark. > [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