java.util.logging.Level needs to implement Comparable<Level>

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 1.4.0, 5.0
    • Component/s: core-libs
    • Cause Known
    • x86
    • windows_2000, windows_xp

      A DESCRIPTION OF THE REQUEST :
      The java.util.logging.Level class has an intrinsic ranking based off of the intValue() associated with any instance.

      In an oversight, however, this class fails to implement Comparable<Level>.

      It would be trivial, just a few lines of code, to modify this class to support that interface. In fact, here is the code:

      public int compareTo(Level other) {
          if (other == null) throw new IllegalArgumentException("other == null");
          
          return this.intValue() - other.intValue();
      }

      This ranking should be used in

      JUSTIFICATION :
      I have an application (a log file reviewer) that needs to prioritize LogRecords for viewing purposes.

      Having Level implement Comparable<Level> would solve all of this.

      By the way, is there a link to the 1.6 (beta at this point) javadocs? Maybe you guys have already fixed this in 1.6 but I can't tell.

            Assignee:
            Unassigned
            Reporter:
            Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: