Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345947

Summary: [1.5][compiler] Suspect name clash problem from eclipse.
Product: [Eclipse Project] JDT Reporter: Srikanth Sankaran <srikanth_sankaran>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Srikanth Sankaran CLA 2011-05-16 09:41:22 EDT
The following program generates a name clash error with eclipse
while javac 5,6,7 compile it alright. At first glance, eclipse
behavior appears suspect:


abstract class I {
    abstract I b();
}
abstract class J extends I {
    abstract <U> J b();
}
Comment 1 Srikanth Sankaran CLA 2011-05-16 09:43:34 EDT
This is a follow up from bug 334306. The fix should also include
a regression test for the interface case.
Comment 2 Srikanth Sankaran CLA 2011-05-16 10:13:24 EDT
(In reply to comment #1)
> This is a follow up from bug 334306. The fix should also include
> a regression test for the interface case.


We have a regression test for the interface scenario in
org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest.test144()
Comment 3 Srikanth Sankaran CLA 2011-05-16 10:32:21 EDT
(In reply to comment #2)

> We have a regression test for the interface scenario in
> org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest.test144()

Also org.eclipse.jdt.core.tests.compiler.regression.AmbiguousMethodTest.test076()
and 
org.eclipse.jdt.core.tests.compiler.regression.AmbiguousMethodTest.test079()
Comment 4 Srikanth Sankaran CLA 2012-01-11 23:23:41 EST
Adding the following lines:


	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=345947
	if (!current.areTypeVariableErasuresEqual(original)) {
		return false;
	}


just before reporting methodNameClash in org.eclipse.jdt.internal.compiler.lookup.MethodVerifier15.detectNameClash(MethodBinding, MethodBinding, boolean) fixes the issue.

This results in a total of 75 test failures in:
AmbiguousMethodTest, MethodVerifyTest, GenericTypeTest.

Some of the "failing" cases simply call for remastering the
expected output, as the new behavior matches with javac, a
few others still needs more analysis.

The fact that Sun compiler has its own idiosyncrasies (and bugs)
makes this exercise a bit more involved.

Don't expect to have time now. Will take this up later.
Comment 5 Eclipse Genie CLA 2019-12-24 06:26:57 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.