harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v..@apache.org
Subject svn commit: r649164 - /harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTest.java
Date Thu, 17 Apr 2008 16:07:58 GMT
Author: vmz
Date: Thu Apr 17 09:07:55 2008
New Revision: 649164

URL: http://svn.apache.org/viewvc?rev=649164&view=rev
Log:
HARMONY-5622 [drlvm][kernel][geronimo] Method.getGeneric*() methods throw NPE for parametrized
interface methods
Committed regression test back to kernel tests - test was redesigned to use a separate thread
to avoid stack overflow.

Modified:
    harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTest.java

Modified: harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTest.java?rev=649164&r1=649163&r2=649164&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTest.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/reflect/MethodTest.java Thu Apr
17 09:07:55 2008
@@ -332,4 +332,42 @@
             fail("Error2: " + e.toString());
         }
     }
+
+    interface GenericSample {
+        public <T extends GenericSample, E extends Throwable> T test(T param) throws
E;
+    }
+
+    boolean success;
+
+    public void test_getGeneric() throws Exception {
+        // Regression for HARMONY-5622
+        success = false;
+        Thread thread = new Thread() {
+            public void run() {
+                try { // Using separate thread to avoid stack overflow
+                    Method method = GenericSample.class.getMethods()[0];
+                    for (int i = 0; i < 5; i++) {
+                        switch (i) {
+                        case 0: method.getGenericParameterTypes();
+                            break;
+                        case 1: method.getGenericReturnType();
+                            break;
+                        case 2: method.getGenericExceptionTypes();
+                            break;
+                        case 3: method.getTypeParameters();
+                            break;
+                        case 4: method.toGenericString();
+                            break;
+                        }
+                    }
+                    success = true;
+                } catch (Throwable e) {
+                    e.printStackTrace();
+                }
+            }
+        };
+        thread.start();
+        thread.join();
+        assert(success);
+    }
 }



Mime
View raw message