JDK-7007615 : java_util/generics/phase2/NameClashTest02 fails since jdk7/pit/b123.
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-12-17
  • Updated: 2018-05-21
  • Resolved: 2011-03-08
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
7 b130Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
jdk-version: jdk7/pit/b123

Test cases:
java_util/generics/phase2/NameClashTest02	execute_script	corelibs,NameClashTest02,generics,pit,mustang


Log:
http://sqeweb.sfbay.sun.com/nfs/results/libs/pit/7/b123/gtee/solaris-sparc/7-b123_pit_libs_solaris-sparc/ResultDir/NameClashTest02/NameClashTest02.log
...
[2010-12-15T06:30:48.46] /export/local/common/jdk/baseline/solaris-sparc/bin/javac NameClashTest02.java
[2010-12-15T06:30:48.46] 
[2010-12-15T06:30:48.46] File Name : NameClash02.java]
[2010-12-15T06:30:48.46] 
[2010-12-15T06:30:48.46] File Name : NameClash02.java]
[2010-12-15T06:30:48.46] 
[2010-12-15T06:30:48.46] File Name : NameClash02.java]
[2010-12-15T06:30:48.46]  Compilation result =false
[2010-12-15T06:30:48.46] TEST FAILED: Compilation should have failed
[2010-12-15T06:30:48.46] Test Failed
[2010-12-15T06:30:48.46] # Test level exit status: 1
[2010-12-15T06:30:48.46] # Host info: SunOS sqe-iteam-5 5.10 Generic_127127-09 sun4u sparc SUNW,Sun-Blade-2500
...
Following compiler error(actual) is not expected

actual : ./NameClash02.java:21: name clash: foo(T) in AX and foo(java.lang.Number) in DX have the same erasure, yet neither overrides the other
    void foo(Integer t) { System.out.println("D#foo(Integer): " + t); }
         ^
expected : NameClash02.java:18: name clash: bar(BX<?>) in DX and bar(BX) in BX have the same erasure, yet neither overrides the other

Test code attached.

Comments
SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk7/tl/langtools/rev/96d4226bdd60
07-02-2011

EVALUATION The new check for override/hide clashes implemented in the fix for 6476118 causes a regression in the javac output. There are two difference between the old and the new check: *) ALL clashing methods used to trigger errors vs. first clash only triggers error (new check) *) when a clash is detected the new algorithm seems to generate two errors, one for each method involved in the clash. While it is important to change javac in order to produce the same output as before, note that the compiler still rejcects ill-formed programs as mandated by the JLS (i.e. if a clash is resolved and there are two clashes, the compiler will start complaining about the second one - that is, the second error is still caught by the compiler, but it is not always displayed).
04-01-2011

EVALUATION Need to investigate...
17-12-2010