Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-258

Frequency class Javadoc is ambiguous; need more tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: