harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r517159 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/EventDispatchThread.java test/api/java/common/java/awt/EventDispatchThreadRTest.java
Date Mon, 12 Mar 2007 10:05:43 GMT
Author: apetrenko
Date: Mon Mar 12 03:05:40 2007
New Revision: 517159

URL: http://svn.apache.org/viewvc?view=rev&rev=517159
Log:
Patch for HARMONY-2116 "[classlib][awt] Toolkit.getDesktopProperties () prints NullPointerException."

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventDispatchThreadRTest.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=517159&r1=517158&r2=517159
==============================================================================
--- 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
Mon Mar 12 03:05:40 2007
@@ -85,7 +85,8 @@
                 }
             }
             } catch (Throwable t) {
-                t.printStackTrace();
+                // TODO: Exception handler should be implemented
+                // t.printStackTrace();
             }
         }
     }

Modified: 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=diff&rev=517159&r1=517158&r2=517159
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventDispatchThreadRTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/EventDispatchThreadRTest.java
Mon Mar 12 03:05:40 2007
@@ -16,17 +16,21 @@
  */
 package java.awt;
 
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
 import junit.framework.TestCase;
 
-/*
- * Regression test for JIRA issue HARMONY-2818
- */
 public class EventDispatchThreadRTest extends TestCase {
+    
+    /**
+     * Regression test for JIRA issue HARMONY-2818
+     */
     public final void testHARMONY2818() throws Throwable {
         EventQueue.invokeLater(
             new Runnable() {
                 public void run() {
-                    throw new RuntimeException("expected from EDT");
+                    throw new RuntimeException("expected from EDT"); //$NON-NLS-1$
                 }
             }
         );
@@ -36,5 +40,24 @@
                 }
             }
         );
+    }
+    
+    public void testHarmony2116() throws InterruptedException {
+        final ByteArrayOutputStream out = new ByteArrayOutputStream();
+        final PrintStream err = System.err;
+        final Toolkit tk;
+
+        System.setErr(new PrintStream(out));
+        tk = new ToolkitImpl() {
+            protected EventQueue getSystemEventQueueImpl() {
+                return null;
+            }
+        };
+
+        Thread.sleep(100);
+        tk.dispatchThread.shutdown();
+        tk.dispatchThread.join(3000);
+        System.setErr(err);
+        assertEquals(0, out.size());
     }
 }



Mime
View raw message