-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
beta
-
generic
-
generic
Name: yyT116575 Date: 10/02/2001
not appropriate in documentation bug, see
http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Level.html as of Oct 2, 2001
The integer levels used by the Level class are not specified. This makes it hard to
a) provide meaningful integer strings to the parse() method. What is the
resulting Level when I provide "1000" as the argument, as in the example? The
parse() documentation also implies that providing an integer will always return
a Level object. What is the result of parse() when no appropriate level exists?
(Hmm.. is parse() also underspecified?)
b) "chose unique integer level values" in Level subclasses as required by the
documentation. If I want to intruduce a level between two predefined levels, can
I do that or are the predefined levels "dense"? What value should I choose?
Also If I want to define a level with an integer value higher than SEVERE, say
CATASTROPHY, I could use Level.SEVERE.intValue()+1 as the intValue for
CATASTROPHY to make sure that it is higher than all normal Levels. But how can I
be sure that this value is not the same as Level.ALL.intValue() or
Level.OFF.intValue() or exceeding Integer.MAX_VALUE?
If you don't want to change the API ( e.g. make Level final ), your best option
is probably to document the integer values of each Level.
(Review ID: 132991)
======================================================================