JDK-6704655 : Test test/java/lang/reflect/Generics/Probe.java fails under OpenJDK
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: OpenJDK6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-05-19
  • Updated: 2012-09-28
  • Resolved: 2008-05-20
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 7 Other
7Fixed OpenJDK6Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The regression test 

test/java/lang/reflect/Generics/Probe.java

fails under OpenJDK, but passes under the production JDK, because the test reflectively accesses class files only available in the production JDK.  The test should be updated to pass under OpenJDK too.

Comments
SUGGESTED FIX test/java/lang/reflect/Generics>sccs sccsdiff -r1.7 -r1.8 Probe.java ------- Probe.java ------- 26c26 < * @bug 5003916 --- > * @bug 5003916 6704655 34a35,36 > import java.util.*; > import static java.util.Arrays.*; 36c38 < @Classes({ --- > @Classes(value={ 59c61,63 < "java.util.LinkedHashMap$ValueIterator", --- > "java.util.LinkedHashMap$ValueIterator" > }, > sunClasses={ 69c73,75 < String [] names = (Probe.class).getAnnotation(Classes.class).value(); --- > Classes classesAnnotation = (Probe.class).getAnnotation(Classes.class); > List<String> names = > new ArrayList<String>(asList(classesAnnotation.value())); 70a77,82 > if (System.getProperty("java.runtime.name").startsWith("Java(TM)")) { > // Sun production JDK; test crypto classes too > for(String name: classesAnnotation.sunClasses()) > names.add(name); > } > 142a155 > String [] sunClasses(); // list of Sun-production JDK specific classes to probe
20-05-2008

EVALUATION The test should be updated to pass under OpenJDK too. While simply removing references to the problematic class files would be one solution, a better solution would be to test for OpenJDK vs production JDK and only probe for the production-only classes in the latter case.
19-05-2008