United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4899706 : BigInteger should implement generified Comparable

Details
Type:
Enhancement
Submit Date:
2003-08-01
Status:
Resolved
Updated Date:
2003-08-30
Project Name:
JDK
Resolved Date:
2003-08-30
Component:
core-libs
OS:
generic
Sub-Component:
java.math
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0 (tiger)

Related Reports
Relates:
Relates:

Sub Tasks

Description
With the introduction of generics, BigInteger should implement the new generified form of the Comparable interface.

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger

FIXED IN:
tiger

INTEGRATED IN:
tiger
tiger-b18


                                     
2004-06-14
SUGGESTED FIX

src/share/classes/java/math>sccs sccsdiff -r1.60 -r1.61 BigInteger.java

------- BigInteger.java -------
80c80
< public class BigInteger extends Number implements Comparable {
---
> public class BigInteger extends Number implements Comparable<BigInteger> {
2502,2520d2501
<     /**
<      * Compares this BigInteger with the specified Object.  If the Object is a
<      * BigInteger, this method behaves like <tt>compareTo(BigInteger)</tt>.
<      * Otherwise, it throws a <tt>ClassCastException</tt> (as BigIntegers are
<      * comparable only to other BigIntegers).
<      *
<      * @param   o Object to which this BigInteger is to be compared.
<      * @return  a negative number, zero, or a positive number as this
<      *                BigInteger is numerically less than, equal to, or greater
<      *                than <tt>o</tt>, which must be a BigInteger.
<      * @throws  ClassCastException <tt>o</tt> is not a BigInteger.
<      * @see     #compareTo(java.math.BigInteger)
<      * @see     Comparable
<      * @since   1.2
<      */
<     public int compareTo(Object o) {
<       return compareTo((BigInteger)o);
<     }
< 

###@###.### 2003-08-15
                                     
2003-08-15
EVALUATION

A fine idea.

###@###.### 2003-07-31
                                     
2003-07-31



Hardware and Software, Engineered to Work Together