JDK-4657573 : java.util.logging.Level.parse: what is known level
  • Type: Bug
  • Status: Closed
  • Resolution: Duplicate
  • Component: docs
  • Sub-Component: guides
  • Priority: P4
  • Affected Version: 1.4.0
  • OS: solaris_7
  • CPU: sparc
  • Submit Date: 2002-03-25
  • Updated Date: 2017-05-16
  • Resolved Date: 2004-01-07
Related Reports
Duplicate :  
Description

Name: sdR10048			Date: 03/25/2002


JDK1.4 doc for java.util.logging.Level.parse(String)
says:

public static Level parse(String´┐Ż´┐Żname)
                   throws IllegalArgumentException

Parse a level name string into a Level.

The argument string may consist of either a level name or an integer value. 

For example: 

"SEVERE" 
"1000"

Returns:
parsed value
Throws:
    NullPointerException - if the name is null
    IllegalArgumentException - if the value is neither one of the
                               known names nor an integer. 
                               ^^^^^^^^^^^

As it turned out the level name becomes "known" if some level with
such name has been constructed before.
I believe that should be noted explicitly.
======================================================================

Comments
EVALUATION Will document this for Tiger. ###@###.### 2003-10-27Updated javadoc is fine but we have some minor concerns. 1) Quote: ------ Known names are the levels defined by this class (i.e. FINE, FINER, FINEST), or new levels defined by subclasses. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------ It is unclear is it enough to specify some public static final int MY_LEVEL constant in subclass and then parse(String) will detect this level as known one. At this point this spec is ambiguous. In case this means that parse method should be overridden in subclass that should be stated explicitly. Thus I believe that all this stuff (plus "or new levels defined by subclasses") should be placed in subclasses. 2) Also fixed spec (and bug report comments/evaluation as well) does not refer to another issue denoted in description: ------ As it turned out the level name becomes "known" if some level with such name has been constructed before. ------ Such a behaviour is still not specified and causes JCK failure. See bug # 4970409. ###@###.### 2003-12-19
2003-12-19