Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
[Extracted from mailing list so it does not get lost]
The Javadoc is ambiguous - can one add both int and char to the same instance of Frequency?
Depending on how one reads the class Javadoc, this should be allowed,
as one can compare "int" and "char" in the same way that one can
compare "int" and "long" - i.e. both are "comparable". Now "int" and
"char" are not Comparable, but then neither are "int" and "long".
I think the Javadoc needs to make the intention clear, and then the
tests can be enhanced to enforce the documented behaviour.
At present, there's no check to show what happens when int and char are mixed.
There are other tests that should be added, to show what is expected when mixing different Comparable classes.