Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 70117 invoked from network); 17 May 2007 14:06:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 May 2007 14:06:22 -0000 Received: (qmail 82239 invoked by uid 500); 17 May 2007 14:06:28 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 82226 invoked by uid 500); 17 May 2007 14:06:28 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 82217 invoked by uid 99); 17 May 2007 14:06:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:06:28 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:06:22 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id E7B441A9838; Thu, 17 May 2007 07:06:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r538930 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java Date: Thu, 17 May 2007 14:06:01 -0000 To: commits@harmony.apache.org From: xli@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070517140601.E7B441A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: xli Date: Thu May 17 07:06:00 2007 New Revision: 538930 URL: http://svn.apache.org/viewvc?view=rev&rev=538930 Log: HARMONY-3883 : [classlib]WeakHashMap.keySet().toArray() intermittently throws NoSuchElementException in java.lang.ThreadTest of DRLVM kernel test. Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java?view=diff&rev=538930&r1=538929&r2=538930 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/WeakHashMap.java Thu May 17 07:06:00 2007 @@ -383,6 +383,26 @@ } }); } + + @Override + public Object[] toArray() { + Collection coll = new ArrayList(size()); + + for (Iterator iter = iterator(); iter.hasNext();) { + coll.add(iter.next()); + } + return coll.toArray(); + } + + @Override + public T[] toArray(T[] contents) { + Collection coll = new ArrayList(size()); + + for (Iterator iter = iterator(); iter.hasNext();) { + coll.add(iter.next()); + } + return coll.toArray(contents); + } }; } return keySet;