harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r475590 - in /incubator/harmony/enhanced/drlvm/trunk/vm: tests/kernel/java/lang/reflect/MethodTestInvoke.java vmcore/src/exception/exceptions_impl.cpp
Date Thu, 16 Nov 2006 05:50:01 GMT
Author: varlax
Date: Wed Nov 15 21:50:01 2006
New Revision: 475590

URL: http://svn.apache.org/viewvc?view=rev&rev=475590
Log:
Fixed regression in exceptions, added test.
Kernel tests pass now

Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTestInvoke.java
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTestInvoke.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTestInvoke.java?view=diff&rev=475590&r1=475589&r2=475590
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTestInvoke.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTestInvoke.java
Wed Nov 15 21:50:01 2006
@@ -29,7 +29,27 @@
 
 import junit.framework.TestCase;
 
-@SuppressWarnings(value={"all"}) public class MethodTestInvoke extends TestCase {
+@SuppressWarnings(value={"all"}) 
+public class MethodTestInvoke extends TestCase {
+    
+    static class MyException extends RuntimeException {}
+    
+    public static void doFail() {
+        throw new MyException();
+    }
+    
+    /**
+     * Tests that correct cause of reflection error is provided.
+     */
+    public void testInvocationTargetExceptionCause() throws Exception {
+        try {
+            this.getClass().getMethod("doFail").invoke(null);
+        } catch (InvocationTargetException e) {
+            Throwable cause = e.getCause();
+            assertTrue("Unexpected cause: " + cause, 
+                    cause instanceof MyException);
+        }
+    }
 
     int state = 0;
     

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp?view=diff&rev=475590&r1=475589&r2=475590
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp Wed
Nov 15 21:50:01 2006
@@ -281,7 +281,7 @@
 
         if (NULL != exception->exc_cause) {
             tmn_suspend_disable_recursive();
-            jthrowable exc_cause = oh_allocate_local_handle();
+            exc_cause = oh_allocate_local_handle();
             exc_cause->object = exception->exc_cause;
             tmn_suspend_enable_recursive();
         }



Mime
View raw message