Bug 106513 - Editor shows dependent error, but hides main problem cause
Summary: Editor shows dependent error, but hides main problem cause
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-09 12:23 EDT by Markus Keller CLA
Modified: 2009-04-28 01:57 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 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