changeset 7739:b91f37560a95

8015780: java/lang/reflect/Method/GenericStringTest.java failing Reviewed-by: darcy, jfranck
author vromero
date Thu, 08 Jan 2015 16:53:49 +0000
parents 4960f7151992
children c50717143e6d
files test/java/lang/reflect/Method/GenericStringTest.java
diffstat 1 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/lang/reflect/Method/GenericStringTest.java	Thu Jan 08 15:12:33 2015 +0000
+++ b/test/java/lang/reflect/Method/GenericStringTest.java	Thu Jan 08 16:53:49 2015 +0000
@@ -47,10 +47,18 @@
                 if (egs != null) {
                     String actual = method.toGenericString();
                     System.out.println(actual);
-                    if (! egs.value().equals(actual)) {
-                        failures++;
-                        System.err.printf("ERROR: Expected ''%s''; got ''%s''.\n",
-                                          egs.value(), actual);
+                    if (method.isBridge()) {
+                        if (! egs.bridgeValue().equals(actual)) {
+                            failures++;
+                            System.err.printf("ERROR: Expected ''%s''; got ''%s''.\n",
+                                              egs.value(), actual);
+                        }
+                    } else {
+                        if (! egs.value().equals(actual)) {
+                            failures++;
+                            System.err.printf("ERROR: Expected ''%s''; got ''%s''.\n",
+                                              egs.value(), actual);
+                        }
                     }
                 }
 
@@ -116,7 +124,8 @@
 
 class Roebling implements Comparable<Roebling> {
     @ExpectedGenericString(
-   "public int Roebling.compareTo(Roebling)")
+    value="public int Roebling.compareTo(Roebling)",
+    bridgeValue="public int Roebling.compareTo(java.lang.Object)")
     public int compareTo(Roebling r) {
         throw new IllegalArgumentException();
     }
@@ -132,9 +141,11 @@
 @Retention(RetentionPolicy.RUNTIME)
 @interface ExpectedGenericString {
     String value();
+    String bridgeValue() default "";
 }
 
 @Retention(RetentionPolicy.RUNTIME)
 @interface ExpectedString {
     String value();
 }
+