Bug 220967 - [compiler] Extra secondary error in presence of missing type
Summary: [compiler] Extra secondary error in presence of missing type
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-29 11:43 EST by Philipe Mulet CLA
Modified: 2008-03-25 13:04 EDT (History)
0 users

See Also:


Attachments
Proposed patch (12.35 KB, patch)
2008-02-29 12:34 EST, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2008-02-29 11:43:56 EST
Version: 3.4.0
Build id: I20080227-1100

Minor consequence of bug 196200, the following code now produces 2 errors instead of 1:

import java.util.List;
interface B {
  List<String> m(CharSequence seq);
}
public class X implements B {
	public ArrayList<String> m(CharSequence arg0) {
		return null;
	}


Only error 1 should be surfaced.

----------
1. ERROR in X.java (at line 6)
	public ArrayList<String> m(CharSequence arg0) {
	       ^^^^^^^^^
ArrayList cannot be resolved to a type
----------
2. ERROR in X.java (at line 6)
	public ArrayList<String> m(CharSequence arg0) {
	       ^^^^^^^^^^^^^^^^^
The return type is incompatible with B.m(CharSequence)
----------
Comment 1 Philipe Mulet CLA 2008-02-29 11:51:31 EST
Variation, also produces 2 errors instead of 1:
import java.util.ArrayList;
public class X {
	public List<String> m(ArrayList<String> l) {
		return l;
	}
}
should only complain about missing 'List'
Comment 2 Philipe Mulet CLA 2008-02-29 12:10:06 EST
Other testcase should only report one issue (missing IOException):
import java.util.List;
interface B {
  void m() throws Exception;
}
public class X implements B {
	public void m() throws IOException {
	}
}

currently it also reports incompatibilty between IOException and Exception.
Comment 3 Philipe Mulet CLA 2008-02-29 12:21:58 EST
Added ProblemTypeAndMethod#test078-079
Comment 4 Philipe Mulet CLA 2008-02-29 12:34:29 EST
Created attachment 91213 [details]
Proposed patch
Comment 5 Philipe Mulet CLA 2008-02-29 16:16:06 EST
Released for 3.4M6
Fixed
Comment 6 Frederic Fusier CLA 2008-03-25 13:04:12 EDT
Verified for 3.4M6 using I20080324-1300.