JDK-6873951 : [TEST_BUG] test/java/lang/reflect/Generics/Probe.java fails
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 6u111,7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-08-20
  • Updated: 2015-11-27
  • Resolved: 2009-09-11
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 6 JDK 7
6u111Fixed 7 b72Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
test/java/lang/reflect/Generics/Probe.java has started to recently failed, due to changes in the JCE build. Here's a sample failure from a JPRT run:


TEST: java/lang/reflect/Generics/Probe.java
JDK under test: (/tmp/jprt/P1/T/075116.ab23780/testproduct/solaris_sparc_5.10-product)
java version "1.7.0-2009-08-20-075116.ab23780.jdk"
Java(TM) SE Runtime Environment (build 1.7.0-2009-08-20-075116.ab23780.jdk-jprtadm_2009_08_20_01_05-b00)
Java HotSpot(TM) Server VM (build 16.0-b07, mixed mode)

ACTION: compile -- Passed. Compilation successful
REASON: User specified action: run compile -source 1.5 Probe.java 
TIME:   1.239 seconds
messages:
command: compile -source 1.5 /tmp/jprt/P1/T/075116.ab23780/source/test/java/lang/reflect/Generics/Probe.java
reason: User specified action: run compile -source 1.5 Probe.java 
elapsed time (seconds): 1.239
STDOUT:
STDERR:

ACTION: build -- Passed. All files up to date
REASON: Named class compiled on demand
TIME:   0.0 seconds
messages:
command: build Probe
reason: Named class compiled on demand
elapsed time (seconds): 0.0

ACTION: main -- Failed. Execution failed: `main' threw exception: java.lang.ClassNotFoundException: javax/crypto/SunJCE_c
REASON: User specified action: run main Probe 
TIME:   0.291 seconds
messages:
command: main Probe
reason: User specified action: run main Probe 
elapsed time (seconds): 0.291
STDOUT:

:
:

CLASS javax.crypto.SunJCE_c
STDERR:
java.lang.ClassNotFoundException: javax/crypto/SunJCE_c
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at Probe.main(Probe.java:86)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:623)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:717)

JavaTest Message: Test threw exception: java.lang.ClassNotFoundException: javax/crypto/SunJCE_c
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.ClassNotFoundException: javax/crypto/SunJCE_c

TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.ClassNotFoundException: javax/crypto/SunJCE_c
VM hotspot test 
java/lang/reflect/Generics/Probe.java 
also fails.

Comments
SUGGESTED FIX # HG changeset patch # User darcy # Date 1252095077 25200 # Node ID c34f92a4724597e51955b09e3dff2a15c39e64f7 # Parent 98ad1322051e6b9667ed5c4b3a4500da73cfd106 6873951: test/java/lang/reflect/Generics/Probe.java fails. Reviewed-by: alanb --- a/test/java/lang/reflect/Generics/Probe.java Fri Sep 04 14:59:20 2009 +0800 +++ b/test/java/lang/reflect/Generics/Probe.java Fri Sep 04 13:11:17 2009 -0700 @@ -23,11 +23,9 @@ /* * @test - * @bug 5003916 6704655 + * @bug 5003916 6704655 6873951 * @summary Testing parsing of signatures attributes of nested classes * @author Joseph D. Darcy - * @compile -source 1.5 Probe.java - * @run main Probe */ import java.lang.reflect.*; @@ -35,50 +33,34 @@ import java.util.*; import java.util.*; import static java.util.Arrays.*; -@Classes(value={ - "java.util.concurrent.FutureTask", - "java.util.concurrent.ConcurrentHashMap$EntryIterator", - "java.util.concurrent.ConcurrentHashMap$KeyIterator", - "java.util.concurrent.ConcurrentHashMap$ValueIterator", - "java.util.AbstractList$ListItr", - "java.util.EnumMap$EntryIterator", - "java.util.EnumMap$KeyIterator", - "java.util.EnumMap$ValueIterator", - "java.util.IdentityHashMap$EntryIterator", - "java.util.IdentityHashMap$KeyIterator", - "java.util.IdentityHashMap$ValueIterator", - "java.util.WeakHashMap$EntryIterator", - "java.util.WeakHashMap$KeyIterator", - "java.util.WeakHashMap$ValueIterator", - "java.util.TreeMap$EntryIterator", - "java.util.TreeMap$KeyIterator", - "java.util.TreeMap$ValueIterator", - "java.util.HashMap$EntryIterator", - "java.util.HashMap$KeyIterator", - "java.util.HashMap$ValueIterator", - "java.util.LinkedHashMap$EntryIterator", - "java.util.LinkedHashMap$KeyIterator", - "java.util.LinkedHashMap$ValueIterator" - }, - sunClasses={ - "javax.crypto.SunJCE_c", - "javax.crypto.SunJCE_e", - "javax.crypto.SunJCE_f", - "javax.crypto.SunJCE_j", - "javax.crypto.SunJCE_k", - "javax.crypto.SunJCE_l" - }) +@Classes({"java.util.concurrent.FutureTask", + "java.util.concurrent.ConcurrentHashMap$EntryIterator", + "java.util.concurrent.ConcurrentHashMap$KeyIterator", + "java.util.concurrent.ConcurrentHashMap$ValueIterator", + "java.util.AbstractList$ListItr", + "java.util.EnumMap$EntryIterator", + "java.util.EnumMap$KeyIterator", + "java.util.EnumMap$ValueIterator", + "java.util.IdentityHashMap$EntryIterator", + "java.util.IdentityHashMap$KeyIterator", + "java.util.IdentityHashMap$ValueIterator", + "java.util.WeakHashMap$EntryIterator", + "java.util.WeakHashMap$KeyIterator", + "java.util.WeakHashMap$ValueIterator", + "java.util.TreeMap$EntryIterator", + "java.util.TreeMap$KeyIterator", + "java.util.TreeMap$ValueIterator", + "java.util.HashMap$EntryIterator", + "java.util.HashMap$KeyIterator", + "java.util.HashMap$ValueIterator", + "java.util.LinkedHashMap$EntryIterator", + "java.util.LinkedHashMap$KeyIterator", + "java.util.LinkedHashMap$ValueIterator"}) public class Probe { - public static void main (String[] args) throws Throwable { + public static void main (String... args) throws Throwable { Classes classesAnnotation = (Probe.class).getAnnotation(Classes.class); List<String> names = new ArrayList<String>(asList(classesAnnotation.value())); - - if (System.getProperty("java.runtime.name").startsWith("Java(TM)")) { - // Sun production JDK; test crypto classes too - for(String name: classesAnnotation.sunClasses()) - names.add(name); - } int errs = 0; for(String name: names) { @@ -152,5 +134,4 @@ public class Probe { @Retention(RetentionPolicy.RUNTIME) @interface Classes { String [] value(); // list of classes to probe - String [] sunClasses(); // list of Sun-production JDK specific classes to probe }
04-09-2009

PUBLIC COMMENTS See http://hg.openjdk.java.net/jdk7/tl/jdk/rev/c34f92a47245
04-09-2009

EVALUATION Yes, if the class structure is changed, the Probe may fail.
21-08-2009