Bug 384580 - Apply changes in JLS 8.4.5 to calculation of duplicate method return types
Summary: Apply changes in JLS 8.4.5 to calculation of duplicate method return types
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.3 M6   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 380188
  Show dependency tree
 
Reported: 2012-07-09 05:06 EDT by Ayushman Jain CLA
Modified: 2013-03-12 04:45 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ayushman Jain CLA 2012-07-09 05:06:35 EDT
BETA_JAVA8

The new JLS 8.4.5 has a slightly different way of finding out duplicate method return types so that the following case which didn't compile with JDK <= 1.7, should start to compile with JDK 1.8. This should be fixed in Eclipse also for compliance > 1.7

package p;

import java.util.List;

interface X { <T> List<T> m(); }
interface Y<K> { List<K> m(); }
interface Z extends X, Y {}  // error here

JDK8 ver. b40 compiles this case
Comment 1 Srikanth Sankaran CLA 2012-10-02 03:05:44 EDT
This code compiles with JDK5,6,7,8. Eclipse compiles at 1.5, 1.6 modes.
Comment 2 Srikanth Sankaran CLA 2013-02-10 22:40:43 EST
(In reply to comment #0)
> BETA_JAVA8
> 
> The new JLS 8.4.5 has a slightly different way of finding out duplicate
> method return types so that the following case which didn't compile with JDK
> <= 1.7, should start to compile with JDK 1.8. This should be fixed in
> Eclipse also for compliance > 1.7
> 
> package p;
> 
> import java.util.List;
> 
> interface X { <T> List<T> m(); }
> interface Y<K> { List<K> m(); }
> interface Z extends X, Y {}  // error here
> 
> JDK8 ver. b40 compiles this case

At the level of Z, the methods have unrelated signatures and it is OK to
not complain. To have determined right at compile time of Z that this
interface is not implementable by anyone would be nice, but calls for
a bit of AI. The programmer will anyway know soon, soon enough ;-)

That said per comment#1, this code has been compiling all along with eclipse
and javac. So it is not a surprise that 8b40 is compiling it.

Test released via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=1fd2e6f3ce4f8526b5b34eb193c45912e205d203
Comment 3 shankha banerjee CLA 2013-03-11 06:05:44 EDT
Verified for 4.3 M6 using  build I20130310-2000
Comment 4 shankha banerjee CLA 2013-03-11 06:06:58 EDT
Verified for 4.3 M6 using  build I20130310-2000