United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4657573 : java.util.logging.Level.parse: what is known level

Details
Type:
Bug
Submit Date:
2002-03-25
Status:
Closed
Updated Date:
2004-03-29
Project Name:
JDK
Resolved Date:
2004-01-07
Component:
docs
OS:
solaris_7
Sub-Component:
guides
CPU:
sparc
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.4.0
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

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



Hardware and Software, Engineered to Work Together