< prev index next >

test/hotspot/jtreg/runtime/exceptionMsgs/AbstractMethodError/AbstractMethodErrorTest.java

Print this page
rev 49017 : 8197405: Improve messages of AbstractMethodErrors and IncompatibleClassChangeErrors.
Reviewed-by: coleenp, dholmes
rev 49018 : [mq]: EditsDavidII.patch

@@ -39,11 +39,11 @@
 
 import sun.hotspot.WhiteBox;
 import compiler.whitebox.CompilerWhiteBoxTest;
 import java.lang.reflect.Method;
 
-// This test assembles an errornous installation of classes.
+// This test assembles an errorneous installation of classes.
 // First, compile the test by @compile. This results in a legal set
 // of classes.
 // Then, with jasm, generate incompatible classes that overwrite
 // the class files in the build directory.
 // Last, call the real test throwing an AbstractMethodError and

@@ -110,15 +110,15 @@
             }
         } catch (NoSuchMethodException e) { }
     }
 
     private static String expectedErrorMessageAME1_1 =
-        "Missing implementation of interface method " +
-        "AME1_B.anAbstractMethod()Ljava/lang/String;";
+        "Missing implementation of resolved method abstract " +
+        "anAbstractMethod()Ljava/lang/String; of abstract class AME1_B.";
     private static String expectedErrorMessageAME1_2 =
         "Receiver class AME1_E does not define or inherit an implementation of the " +
-        "resolved method public abstract aFunctionOfMyInterface()Ljava/lang/String; of " +
+        "resolved method abstract aFunctionOfMyInterface()Ljava/lang/String; of " +
         "interface AME1_C.";
 
     public static void test_ame1() {
         AME1_B objectAbstract = new AME1_D();
         AME1_C objectInterface = new AME1_D();

@@ -167,14 +167,15 @@
             throw new RuntimeException("Caught unexpected exception: " + e);
         }
     }
 
     private static String expectedErrorMessageAME2_Interpreted =
-        "Missing implementation of interface method AME2_A.aFunctionOfMyInterface()V";
+        "Missing implementation of resolved method abstract " +
+        "aFunctionOfMyInterface()V of interface AME2_A.";
     private static String expectedErrorMessageAME2_Compiled =
         "Receiver class AME2_C does not define or inherit an implementation of the resolved method " +
-        "public abstract aFunctionOfMyInterface()V of interface AME2_A.";
+        "abstract aFunctionOfMyInterface()V of interface AME2_A.";
 
     public AbstractMethodErrorTest() throws InstantiationException, IllegalAccessException {
         try {
             AME2_B myAbstract = new ImplementsAllFunctions();
             myAbstract.fun2();

@@ -236,11 +237,11 @@
         }
     }
 
     private static String expectedErrorMessageAME3_1 =
         "Receiver class AME3_C does not define or inherit an implementation of the resolved method " +
-        "public ma()V of class AME3_A. Selected method is public abstract AME3_B.ma()V.";
+        "ma()V of class AME3_A. Selected method is abstract AME3_B.ma()V.";
 
     // Testing abstract class that extends a class that has an implementation.
     // Loop so that method gets eventually compiled/osred.
     public static void test_ame3_1() throws Exception {
         AME3_A c = new AME3_C();

@@ -265,12 +266,12 @@
             }
         }
     }
 
     private static String expectedErrorMessageAME3_2 =
-        "Receiver class AME3_C does not define or inherit an implementation of the resolved method " +
-        "public abstract ma()V of abstract class AME3_B.";
+        "Receiver class AME3_C does not define or inherit an implementation of " +
+        "the resolved method abstract ma()V of abstract class AME3_B.";
 
     // Testing abstract class that extends a class that has an implementation.
     // Loop so that method gets eventually compiled/osred.
     public static void test_ame3_2() throws Exception {
         AME3_C c = new AME3_C();

@@ -295,21 +296,22 @@
             }
         }
     }
 
     private static String expectedErrorMessageAME4 =
-        "Missing implementation of interface method AME4_B.ma()V";
+        "Missing implementation of resolved method abstract ma()V of " +
+        "abstract class AME4_B.";
 
     // Testing abstract class that extends a class that has an implementation.
     public static void test_ame4() throws Exception {
         AME4_C c = new AME4_C();
         AME4_D d = new AME4_D();
-        AME4_E e = new AME4_E();  // Errornous.
+        AME4_E e = new AME4_E();  // Errorneous.
 
         AME4_A a;
         try {
-            // Test: calls errornous e.ma() in the last iteration.
+            // Test: calls errorneous e.ma() in the last iteration.
             final int iterations = 10;
             for (int i = 0; i < iterations; i++) {
                 a = e;
                 if (i % 2 == 0 && i < iterations - 1) {
                     a = c;

@@ -413,11 +415,11 @@
         }
     }
 
     private static String expectedErrorMessageAME6_ItableStub =
         "Receiver class AME6_B does not define or inherit an implementation of the resolved" +
-        " method public abstract mc()V of interface AME6_A.";
+        " method abstract mc()V of interface AME6_A.";
 
     // -------------------------------------------------------------------------
     // AbstractMethodErrors detected in itable stubs.
     // Note: How can we verify that we really stepped through the itable stub?
     // - Bimorphic inlining should not happen since we have no profiling data when

@@ -497,11 +499,11 @@
     }
 }
 
 // Helper classes to test abstract method error.
 //
-// Errornous versions of these classes are implemented in java
+// Errorneous versions of these classes are implemented in java
 // assembler.
 
 
 // -------------------------------------------------------------------------
 // This error should be detected interpreted.

@@ -510,11 +512,11 @@
 //
 //      A     C     // interfaces
 //      |     |
 //      B     |     // abstract class
 //       \   /
-//         E        // errornous class implementation lacks method C::aFunctionOfMyInterface
+//         E        // errorneous class implementation lacks method C::aFunctionOfMyInterface
 //
 interface AME1_A {
 
     public String firstFunctionOfMyInterface0();
 

@@ -624,11 +626,11 @@
 //
 //      A   // an interface declaring aFunctionOfMyInterface()
 //      |
 //      B   // an abstract class
 //      |
-//      C   // errornous implementation lacks method A::aFunctionOfMyInterface()
+//      C   // errorneous implementation lacks method A::aFunctionOfMyInterface()
 //
 interface AME2_A {
     public void aFunctionOfMyInterface();
 }
 

@@ -670,11 +672,11 @@
 //
 //           A           // a class implementing m()
 //           |
 //           B           // an abstract class defining m() abstract
 //           |
-//           C           // an errornous class lacking an implementation of m()
+//           C           // an errorneous class lacking an implementation of m()
 //
 class AME3_A {
     public void ma() {
         System.out.print("A.ma() ");
     }

@@ -699,11 +701,11 @@
 //
 //           A           // A: a class implementing ma()
 //           |
 //           B           // B: an abstract class defining ma() abstract
 //        /  | \
-//       C   D  E        // E: an errornous class lacking an implementation of ma()
+//       C   D  E        // E: an errorneous class lacking an implementation of ma()
 //
 class AME4_A {
     public void ma() {
         System.out.print("A.ma() ");
     }

@@ -742,11 +744,11 @@
 //            C D E \
 //                   B  // Bad class, missing method implementation.
 //
 // Test:
 // - Call D.mc() / E.mc() / F.mc() several times to force real vtable call constrution
-// - Call errornous B.mc() in the end to raise the AbstraceMethodError
+// - Call errorneous B.mc() in the end to raise the AbstraceMethodError
 
 abstract class AME5_A {
     abstract void ma();
     abstract void mb();
     abstract void mc();

@@ -820,11 +822,11 @@
 //         C D E \
 //                B (bad class, missing method)
 //
 // Test:
 // - Call D.mc() / E.mc() / F.mc() several times to force real itable call constrution
-// - Call errornous B.mc() in the end to raise the AbstraceMethodError
+// - Call errorneous B.mc() in the end to raise the AbstraceMethodError
 
 interface AME6_A {
     abstract void ma();
     abstract void mb();
     abstract void mc();
< prev index next >