changeset 10887:cc6c74b164df jdk8u60-b20

Merge
author amurillo
date Mon, 15 Jun 2015 22:23:43 -0700
parents 4acc6e025277 (current diff) 6594f91c20f6 (diff)
children 63c9cedeeb9d 29554859c79d
files
diffstat 1 files changed, 23 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/lang/invoke/8022701/InvokeSeveralWays.java	Fri Jun 12 18:46:03 2015 -0700
+++ b/test/java/lang/invoke/8022701/InvokeSeveralWays.java	Mon Jun 15 22:23:43 2015 -0700
@@ -38,12 +38,19 @@
             failures++;
         } catch (InvocationTargetException e) {
             Throwable c = e.getCause();
-            if (expected.isInstance(c))
-               System.out.println("EXPECTED: " + expected.getName() + ", "+ c);
-            else {
-               failures++;
-               System.out.println("FAIL: Unexpected wrapped exception " + c);
-               e.printStackTrace(System.out);
+            if (BootstrapMethodError.class.isInstance(c)) {
+                c = c.getCause();
+                if (expected.isInstance(c))
+                    System.out.println("EXPECTED: " + expected.getName() + ", "+ c);
+                else {
+                    failures++;
+                    System.out.println("FAIL: Unexpected wrapped exception " + c);
+                    e.printStackTrace(System.out);
+                }
+            } else {
+                failures++;
+                System.out.println("FAIL: Exception from MethodHandle invocation not wrapped in BootstrapMethodError " + c);
+                e.printStackTrace(System.out);
             }
         } catch (Throwable e) {
             failures++;
@@ -74,14 +81,19 @@
             Invoker.invoke();
             System.out.println("FAIL: No exception throw, probably failed to load modified bytecodes for MethodSupplier");
             failures++;
-        } catch (Throwable e) {
-            if (expected.isInstance(e))
-               System.out.println("EXPECTED: " + expected.getName() + ", "+ e);
+        } catch (BootstrapMethodError e) {
+            Throwable c = e.getCause();
+            if (expected.isInstance(c))
+                System.out.println("EXPECTED: " + expected.getName() + ", "+ c);
             else {
+                failures++;
+                System.out.println("FAIL: Unexpected exception has been caught " + c);
+                e.printStackTrace(System.out);
+            }
+        } catch (Throwable e) {
             failures++;
-            System.out.println("FAIL: Unexpected exception has been caught " + e);
+            System.out.println("FAIL: Exception from MethodHandle invocation not wrapped in BootstrapMethodError " + e);
             e.printStackTrace(System.out);
-            }
         }
         System.out.println();
         try {