DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=36527>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=36527 Summary: compareTo is inconsistent with equals Product: Commons Version: 2.1 Final Platform: Other OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Lang AssignedTo: [email protected] ReportedBy: [EMAIL PROTECTED] The ordering of the compareTo method method in the Fraction class is inconsistent with equals() because 1/2 is not equal to 2/4. However 1/2.compareTo(2/4) is 0. My gut feeling is that the equals method is broken and should be fixed. 1/2 == 2/4. However if there are good reasons for keeping the current behavior, then at a minimum the inconsistency shoudl be called out in the JavaDoc, and users should be warned against using fractions in hash tables and sorted maps and the like. For background see http://java.sun.com/j2se/1.3/docs/api/java/lang/Comparable.html -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
