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.
JDK 7 JDK 8
7u80Fixed 8 b105Fixed
Related Reports
Duplicate :  
Relates :  
Description
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
#checksum:ef9803261f550ec
#-----testdescription-----
$file=/u/alanb/ws/tl/jdk/test/java/lang/reflect/Method/GenericStringTest.java
$root=/u/alanb/ws/tl/jdk/test
author=Joseph D. Darcy
keywords=bug5033583 bug6316717 bug6470106 bug8004979
run=ASSUMED_ACTION main GenericStringTest\n
source=GenericStringTest.java
title=Check toGenericString() and toString() methods

#-----environment-----

#-----testresult-----
description=file\:/u/alanb/ws/tl/jdk/test/java/lang/reflect/Method/GenericStringTest.java
elapsed=162 0\:00\:00.162
end=Mon Jun 03 08\:45\:54 IST 2013
environment=regtest
execStatus=Failed. Execution failed\: `main' threw exception\: java.lang.RuntimeException
hostname=ashtown.ie.oracle.com
javatestOS=Linux 3.2.0-23-generic (amd64)
javatestVersion=4.4
jtregVersion=jtreg 4.1 dev b00
script=com.sun.javatest.regtest.RegressionScript 
sections=script_messages build compile main
start=Mon Jun 03 08\:45\:54 IST 2013
test=java/lang/reflect/Method/GenericStringTest.java
user.name=albatem
work=/u/alanb/testing/jtreg/JTwork/java/lang/reflect/Method

#section:script_messages
----------messages:(5/271)----------
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)


#section:build
----------messages:(3/101)----------
command: build GenericStringTest
reason: Named class compiled on demand
elapsed time (seconds): 0.08
result: Passed. Build successful

#section:compile
----------messages:(3/195)----------
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

#section:main
----------messages:(3/133)----------
command: main GenericStringTest
reason: Assumed action based on file name: run main GenericStringTest 
elapsed time (seconds): 0.082
----------System.out:(18/890)----------
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)
----------System.err:(14/729)----------
ERROR: Expected ''public int Roebling.compareTo(Roebling)''; got ''public int Roebling.compareTo(java.lang.Object)''.
Test failed.
java.lang.RuntimeException
	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

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

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.
04-06-2013

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