-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
1.4.0, 5.0
-
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.
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.
- duplicates
-
JDK-4800433 RFE: java.util.logging.Level is not Comparable
-
- Closed
-
-
JDK-6818054 java.util.logging.Level should implement Comparable<Level>
-
- Closed
-