David Holmes reports:
While updating defmeth tests for nestmates (JEP 181) I encountered a number of issues:
1. Known failure modes that seem out of date
With the following patch the basic* test still all pass:
diff -r 2657e4188322 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
--- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
+++ b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
@@ -150,7 +150,6 @@
* }
*
*/
- @KnownFailure(modes = {INVOKE_EXACT, INVOKE_GENERIC, INVOKE_WITH_ARGS, INDY}) // NPE, instead of IAE
public void testNonPublicOverride() {
TestBuilder b = factory.getBuilder();
2. Expected exceptions are far too broad in some cases ie LinkageError instead of a more specific IllegalAccessError, or NoSuchMethodError, or AbstractMehtodError. Tests could pass yet actually be encountering completely wrong exceptions.
3. Reflection tests often fail with NoSuchMethodError. This suggests that in some cases we may be looking up the method on the wrong class, or using getMethod instead of getDeclaredMethod.
While updating defmeth tests for nestmates (JEP 181) I encountered a number of issues:
1. Known failure modes that seem out of date
With the following patch the basic* test still all pass:
diff -r 2657e4188322 test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
--- a/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
+++ b/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
@@ -150,7 +150,6 @@
* }
*
*/
- @KnownFailure(modes = {INVOKE_EXACT, INVOKE_GENERIC, INVOKE_WITH_ARGS, INDY}) // NPE, instead of IAE
public void testNonPublicOverride() {
TestBuilder b = factory.getBuilder();
2. Expected exceptions are far too broad in some cases ie LinkageError instead of a more specific IllegalAccessError, or NoSuchMethodError, or AbstractMehtodError. Tests could pass yet actually be encountering completely wrong exceptions.
3. Reflection tests often fail with NoSuchMethodError. This suggests that in some cases we may be looking up the method on the wrong class, or using getMethod instead of getDeclaredMethod.
- relates to
-
JDK-8036580 CHA: Improve default method support
-
- Resolved
-