This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 109712 - compareTo(T o) but not compareTo(Object o)
Summary: compareTo(T o) but not compareTo(Object o)
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: Sun Windows XP
: P1 blocker (vote)
Assignee: issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-14 04:05 UTC by helen43699
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description helen43699 2007-07-14 04:05:29 UTC
CompareTo() method should take an argument of the type you are sorting, but not an argument of type Object.
Comment 1 novakm 2007-07-16 12:00:11 UTC
Reassigning to java for evaluation.
Comment 2 Jiri Prox 2007-07-16 13:08:43 UTC
I cannot see any problems with automatic addition compareTo() method.

The type of argument depends on the style of declaration. It should be compareTo(java.lang.Object) if don't specify the
generic type, e.g. use declaration "class X implements Comparable { ....", otherwise the type is the same as used in
declaration e.g. "class X implements Comparable<String> { ....  public int comparerTo(String arg){ ...."