JDK-8005138 : test/java/beans/Introspector/TestTypeResolver.java fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-12-18
  • Updated: 2014-10-13
  • Resolved: 2013-01-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b75Fixed
Related Reports
Relates :  
Description
The test/java/beans/Introspector/TestTypeResolver.java regression test now fails following addition of:

<T extends Annotation> T[] getDeclaredAnnotations(Class<T> annotationClass);

to java.lang.reflect.AnnotatedElement.

An excerpt from the .jtr file:

----------messages:(3/181)----------
command: compile /Users/bchristi/WS/jnuenv/tl/jdk/test/java/beans/Introspector/TestTypeResolver.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.612
----------System.out:(0/0)----------
----------System.err:(84/7666)----------
...
/Users/bchristi/WS/jnuenv/tl/jdk/test/java/beans/Introspector/TestTypeResolver.java:192: error: ClassTypeVariable is not abstract and does not override abstract method <T>getDeclaredAnnotations(Class<T>) in AnnotatedElement
    private static class ClassTypeVariable extends TypeVariableImpl<Class<?>> {
                   ^
  where T is a type-variable:
    T extends Annotation declared in method <T>getDeclaredAnnotations(Class<T>)
/Users/bchristi/WS/jnuenv/tl/jdk/test/java/beans/Introspector/TestTypeResolver.java:198: error: MethodTypeVariable is not abstract and does not override abstract method <T>getDeclaredAnnotations(Class<T>) in AnnotatedElement
    private static class MethodTypeVariable extends TypeVariableImpl<Method> {
                   ^
  where T is a type-variable:
    T extends Annotation declared in method <T>getDeclaredAnnotations(Class<T>)
...
2 errors
24 warnings
result: Failed. Compilation failed: Compilation failed
---

The test case needs to updated to override the new abstract method, or perhaps AnnotatedElement needs a default method for getDeclaredAnnotations()

Comments
http://cr.openjdk.java.net/~malenkov/8005239.0/
24-01-2013

The changes for JDK-7154390 add methods to the AnnotatedElement system interface, which indirection is causing the observed source incompatibility with the test in question. I recommend the test be updated to have stubbed out versions of the new methods.
19-12-2012

This test fails for my JPRT job. My sources contained no changes, and were up-to-date as of this morning (Dec 18, Pacific time). I've attached the test failure log.
18-12-2012

Compiling the test with the promoted build from last week (b68) shows the same failure (the test code has not been updated in over a month). I don't know what could cause this to fail in just my environment. AFAIK JPRT does not run jdk_beans tests by default. Can you send me a link to a JPRT job (or TL nightly job) that shows this test passing? In the meantime, I will submit a JPRT job that includes testing for jdk_beans1.
18-12-2012