JDK-8015780 : java/lang/reflect/Method/GenericStringTest.java failing
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 7u80,8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-06-03
  • Updated: 2015-02-02
  • Resolved: 2013-08-12
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.
7u80Fixed 8 b105Fixed
Related Reports
Duplicate :  
Relates :  
This test started failing in the last day or two, possibly due to a javac fix.

#Test Results (version 2)
#Mon Jun 03 08:45:54 IST 2013
author=Joseph D. Darcy
keywords=bug5033583 bug6316717 bug6470106 bug8004979
run=ASSUMED_ACTION main GenericStringTest\n
title=Check toGenericString() and toString() methods


elapsed=162 0\:00\:00.162
end=Mon Jun 03 08\:45\:54 IST 2013
execStatus=Failed. Execution failed\: `main' threw exception\: java.lang.RuntimeException
javatestOS=Linux 3.2.0-23-generic (amd64)
jtregVersion=jtreg 4.1 dev b00
sections=script_messages build compile main
start=Mon Jun 03 08\:45\:54 IST 2013

JDK under test: (/u/alanb/ws/tl/build/linux-x86_64-normal-server-release/images/j2sdk-image)
java version "1.8.0-internal"
Java(TM) SE Runtime Environment (build 1.8.0-internal-albatem_2013_05_22_20_23-b00)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b33, mixed mode)

command: build GenericStringTest
reason: Named class compiled on demand
elapsed time (seconds): 0.08
result: Passed. Build successful

command: compile -XDignore.symbol.file=true /u/alanb/ws/tl/jdk/test/java/lang/reflect/Method/GenericStringTest.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.08
result: Passed. Compilation successful

command: main GenericStringTest
reason: Assumed action based on file name: run main GenericStringTest 
elapsed time (seconds): 0.082
void TestClass1.method1(int,double)
static void TestClass1.method3() throws java.lang.RuntimeException
private static java.lang.String TestClass1.method2(int,int)
protected <S,T> S TestClass1.method4(S,T) throws java.lang.Exception
public <T> T TestClass2.method1(E,T)
public void TestClass2.method2() throws F
void Roebling.varArg(java.lang.Object...)
public int Roebling.compareTo(Roebling)
public int Roebling.compareTo(java.lang.Object)
public default strictfp double TestInterface1.quux()
public default void TestInterface1.foo()
public default <A> A TestInterface1.bar()
Generic: void Roebling.varArg(java.lang.Object...)
Regular: void Roebling.varArg(java.lang.Object[])
Generic: public int Roebling.compareTo(Roebling)
Regular: public int Roebling.compareTo(Roebling)
Generic: public int Roebling.compareTo(java.lang.Object)
Regular: public int Roebling.compareTo(java.lang.Object)
ERROR: Expected ''public int Roebling.compareTo(Roebling)''; got ''public int Roebling.compareTo(java.lang.Object)''.
Test failed.
	at GenericStringTest.main(GenericStringTest.java:85)
	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:491)
	at com.sun.javatest.regtest.MainAction$SameVMRunnable.run(MainAction.java:728)
	at java.lang.Thread.run(Thread.java:724)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException

test result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException

I've added this test to the ProblemList.txt so that it is temporarily excluded while we figure out what to do with it.

Yes it's a side effect of JDK-6695379. For class Roebling, see test, there are two methods generated in the class file: public int compareTo(Roebling); descriptor: (LRoebling;)I and public int compareTo(java.lang.Object); descriptor: (Ljava/lang/Object;)I before JDK-6695379 only the first one had annotations but now after the mentioned patch they both have the following attribute: RuntimeVisibleAnnotations: 0: #15(#16=s#17) Which corresponds to @ExpectedGenericString("public int Roebling.compareTo(Roebling)") in the source code. After JDK-6695379 this annotation is correct only for the first method. One possible, temporary, solution is to modify the test to ignore annotations in bridge methods or to add another annotation for bridge methods only and check the correct one depending on the method. A third option is to add the annotations to the class instead of the methods but this could imply more changes to the test.

Suspect this is a side-effect of the changes for JDK-6695379.