Bug 236096 - Incorrectly allow raw return type in overridden method
Summary: Incorrectly allow raw return type in overridden method
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.1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-06 13:28 EDT by Kent Johnson CLA
Modified: 2008-08-29 04:11 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (1.22 KB, patch)
2008-06-11 15:05 EDT, Kent Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Johnson CLA 2008-06-06 13:28:41 EDT
class Y<T> {
  class M<V> {}
  public <V> M<V> foo() { return null; }
}

public class X<T> extends Y{
  @Override
  public <V> M foo() { return null;  }
}

Should be an error - X.foo does not override Y.foo

And once @Override is removed, we should find a name clash.
Comment 1 Kent Johnson CLA 2008-06-09 12:22:32 EDT
Same problem occurs with

class Y<T> {
	class M<V> {}
	<V> void foo(M<V> m) {}
}
class X<T> extends Y {
	@Override <V> void foo(M m) { }
}


We need to notice that X.foo defines its own type varaible & then cannot match the overridden method using raw types instead of matching parameterized types.
Comment 2 Kent Johnson CLA 2008-06-11 15:05:20 EDT
Created attachment 104541 [details]
Proposed patch
Comment 3 Kent Johnson CLA 2008-07-24 14:43:40 EDT
Released for 3.5M1

Released for 3.4.1

Added MethodVerifyTest 168
Comment 4 Olivier Thomann CLA 2008-08-06 14:13:17 EDT
Verified for 3.5M1 using I20080805-1307
Comment 5 Frederic Fusier CLA 2008-08-28 11:36:47 EDT
Reopen to include the bug in the 3.4.1 verification process
Comment 6 Frederic Fusier CLA 2008-08-28 11:36:55 EDT
.
Comment 7 Frederic Fusier CLA 2008-08-29 04:11:43 EDT
Verified for 3.4.1 using M20080827-2000.