Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 88567 invoked from network); 21 Dec 2006 13:08:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Dec 2006 13:08:30 -0000 Received: (qmail 67656 invoked by uid 500); 21 Dec 2006 13:08:37 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 67639 invoked by uid 500); 21 Dec 2006 13:08:37 -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 67630 invoked by uid 99); 21 Dec 2006 13:08:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Dec 2006 05:08:37 -0800 X-ASF-Spam-Status: No, hits=-9.4 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, 21 Dec 2006 05:08:28 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 447F21A981A; Thu, 21 Dec 2006 05:07:39 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r489342 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/EventDispatchThread.java test/api/java/common/java/awt/EventDispatchThreadRTest.java Date: Thu, 21 Dec 2006 13:07:39 -0000 To: commits@harmony.apache.org From: apetrenko@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061221130739.447F21A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrenko Date: Thu Dec 21 05:07:38 2006 New Revision: 489342 URL: http://svn.apache.org/viewvc?view=rev&rev=489342 Log: Patch for HARMONY-2818 "[classlib][awt] Wrong exception handling in java.awt.EventDispatchThread causes VM hangup" Added: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventDispatchThreadRTest.java (with props) Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java?view=diff&rev=489342&r1=489341&r2=489342 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java Thu Dec 21 05:07:38 2006 @@ -46,16 +46,15 @@ try { runModalLoop(null); - } catch (Exception e) { - e.printStackTrace(); + } finally { + toolkit.shutdownWatchdog.forceShutdown(); } - - toolkit.shutdownWatchdog.forceShutdown(); } void runModalLoop(ModalContext context) { long lastPaintTime = System.currentTimeMillis(); while (!shutdownPending && (context == null || context.isModalLoopRunning())) { + try { EventQueue eventQueue = toolkit.getSystemEventQueueImpl(); NativeEvent ne = nativeQueue.getNextEvent(); @@ -84,6 +83,9 @@ lastPaintTime = System.currentTimeMillis(); waitForAnyEvent(); } + } + } catch (Throwable t) { + t.printStackTrace(); } } } Added: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventDispatchThreadRTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventDispatchThreadRTest.java?view=auto&rev=489342 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventDispatchThreadRTest.java (added) +++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventDispatchThreadRTest.java Thu Dec 21 05:07:38 2006 @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package java.awt; + +import junit.framework.TestCase; + +/* + * Regression test for JIRA issue HARMONY-2818 + */ +public class EventDispatchThreadRTest extends TestCase { + public final void testHARMONY2818() throws Throwable { + EventQueue.invokeLater( + new Runnable() { + public void run() { + throw new RuntimeException("expected from EDT"); + } + } + ); + EventQueue.invokeAndWait( + new Runnable() { + public void run() { + } + } + ); + } +} \ No newline at end of file Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventDispatchThreadRTest.java ------------------------------------------------------------------------------ svn:eol-style = native