Bug 106513

Summary: Editor shows dependent error, but hides main problem cause
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, srikanth_sankaran
Version: 3.1.1   
Target Milestone: 3.5 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2005-08-09 12:23:56 EDT
M20050804-1200

The compiler generates two errors for class Both below:

1. The return type is incompatible with IGeneric<Integer>.get(),
Generic<String>.get()
2. The interface IGeneric cannot be implemented more than once with different
arguments: IGeneric<String> and IGeneric<Integer>

Unfortunately, the editor hover and the status line only show the first message,
which is not very useful in this case. Either problems should be presented in
decreasing importance (here, error 1 is a consequence of error2 and therefore
less important), or the error 1 should be suppressed altogether (that's what
javac does).
 
class Both extends Generic<String> implements IGeneric<Integer> { }
interface IGeneric<B> {
	B get();
}
class Generic<B>implements IGeneric<B> {
	public B get() { return null; }
}

I'm not sure who's responsible for the ordering. Please move to JDT/Text if they
can solve this problem.
Comment 1 Kent Johnson CLA 2009-03-30 10:37:45 EDT
Closing since this has been fixed for some time.

We only produce 1 error in 3.5 and in 3.4.2 :

The interface IGeneric cannot be implemented more than once with different arguments: IGeneric<String> and IGeneric<Integer>
Comment 2 Srikanth Sankaran CLA 2009-04-28 01:57:30 EDT
Verified for 3.5M7 using I20090426-2000