harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r663434 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/EventHandler.java test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
Date Thu, 05 Jun 2008 02:08:09 GMT
Author: qiuxx
Date: Wed Jun  4 19:08:08 2008
New Revision: 663434

URL: http://svn.apache.org/viewvc?rev=663434&view=rev
Log:
Apply for HARMONY-2434, ([classlib][beans] EventHandler.invoke retrows exceptions incorrectly)

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java?rev=663434&r1=663433&r2=663434&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
Wed Jun  4 19:08:08 2008
@@ -105,8 +105,7 @@
                     } catch (RuntimeException e) {
                         throw e;
                     } catch (Throwable t) {
-                        System.out
-                                .println(t.getClass() + ": " + t.getMessage()); //$NON-NLS-1$
+                        throw new RuntimeException(t);
                     }
                 } else {
                     // in order to be compatible with RI

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java?rev=663434&r1=663433&r2=663434&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
Wed Jun  4 19:08:08 2008
@@ -220,6 +220,21 @@
 
         assertEquals("setSomeValue", getMethodName());
     }
+    
+    /**
+     * fileSampleEvent scenario by throwing RuntimeException
+     */
+    public void test_Create_WithThrowRuntimeException() {
+        // Regression for Harmony-2434
+        InvocationObject invocationObject = new InvocationObject();
+        SampleListener listener = EventHandler.create(SampleListener.class,invocationObject,
"throwRuntimeException");
+        try {
+            listener.fireSampleEvent(new SampleEvent("bean"));
+            fail("Expected RuntimeException thrown");
+        } catch (RuntimeException re) {
+            // Expected
+        }
+    }
 
     /**
      * 
@@ -1256,5 +1271,9 @@
             logMethodCall(this, "setSomeValue", new Object[] { new Integer(
                     intValue) });
         }
+        
+        public void throwRuntimeException() {
+            throw new RuntimeException("forced throw RuntimeException");
+        }
     }
 }



Mime
View raw message