Bug 279836 - [1.5][compiler] Eclipse compiler shows error on javac-valid construct: raw types on overridden methods
Summary: [1.5][compiler] Eclipse compiler shows error on javac-valid construct: raw ty...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5.1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-10 13:46 EDT by Zorzella Mising name CLA
Modified: 2009-08-27 15:18 EDT (History)
4 users (show)

See Also:
Olivier_Thomann: review+


Attachments
DelegatingList (2.46 KB, text/x-java)
2009-06-10 13:46 EDT, Zorzella Mising name CLA
no flags Details
Proposed patch and testcase (2.69 KB, patch)
2009-06-18 16:03 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 Zorzella Mising name CLA 2009-06-10 13:46:08 EDT
Created attachment 138828 [details]
DelegatingList

Much like https://bugs.eclipse.org/bugs/show_bug.cgi?id=276800, I distilled down another Eclipse vs javac "validness" disagreement. See attached class.

The error I get on line 13 is:

The type new DelegatingList(){} must implement the inherited abstract method List.set(int, Object)

What seems to be happening in broad terms is that due to the use of raw types, Eclipse is not figuring out that the existing "public T set(int index, T element) {" is said method.
Comment 1 Kent Johnson CLA 2009-06-18 16:03:51 EDT
Created attachment 139584 [details]
Proposed patch and testcase
Comment 2 Kent Johnson CLA 2009-06-18 16:10:04 EDT
Released for 3.6M1 in HEAD

Olivier - please review for 3.5.1
Comment 3 Olivier Thomann CLA 2009-06-24 16:33:30 EDT
+1 for 3.5.1.
Comment 4 Kent Johnson CLA 2009-06-25 10:09:18 EDT
Released to R3_5_maintenance for 3.5.1
Comment 5 Zorzella Mising name CLA 2009-07-17 13:59:02 EDT
Would you check if this is also fixed by this fix, please?

Thanks,

Z

*********************

public class Snippet {
  
  private static final class Contract implements Comparable {
    @Override
    public int compareTo(Object o) {
      return 0;
    }}
  
  public Contract getLatestContract() {
    Collection<Contract> contracts = null;
    return Collections.max(contracts);
  }
}
Comment 6 Kent Johnson CLA 2009-07-20 10:32:53 EDT
Yes the error on compareTo(Object) is 'fixed', but the return type statement
   return Collections.max(contracts);
still produces an error.
Comment 7 Zorzella Mising name CLA 2009-07-20 11:21:07 EDT
Should I file a new bug for this, then?
Comment 8 Srikanth Sankaran CLA 2009-08-04 01:07:31 EDT
Verified for 3.6M1 using build I20090803-1300
Comment 9 Ayushman Jain CLA 2009-08-27 08:43:24 EDT
Verified for 3.5.1 using build M20090826-1100. No problem in the original case. However, for the case given in comment #5, the error on compareTo(Object) is still reported. Filed a new bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=287816
Comment 10 Olivier Thomann CLA 2009-08-27 15:18:28 EDT
Verified.