|
Description
|
JDK1.4rc91 constuctor
protected java.util.logging.Level(String name,
int value,
String resourceBundleName)
does not throw NullPointerException if 'name' == null.
Level(String, int) has the same problem.
Package level spec for java.util.logging says:
----------
Null Pointers
In general, unless otherwise noted in the javadoc, methods and
contructors will throw NullPointerException if passed a null
argument.
The one broad exception to this rule is that the logging
convenience methods in the Logger class (the log, logp, log, severe,
warning, config, fine, finer, and finest methods) will accept null
values for all arguments except for the initial Level argument (if
any).
Consturctor spec says:
----------
protected Level(String name,
int value,
String resourceBundleName)
Create a named Level with a given integer value and a given localization resource name.
Parameters:
name - the name of the Level, for example "SEVERE".
value - an integer value for the level.
resourceBundleName - name of a resource bundle to use in localizing
the given name (may be null).
Demo test:
----------
import java.util.logging.*;
public class Test extends Level {
public Test(String name, int value) {
super(name, value);
}
public Test(String name, int value, String resourceBundleName) {
super(name, value, resourceBundleName);
}
public static void main(String[] args) {
try {
new Test(null, 1, "");
System.out.println("No NPE.");
} catch (NullPointerException e) {
System.out.println( "NPE." );
}
}
}
Demo output:
----------
[archer] ~/tmp
% /set/jdk-builds/JDK1.4.0rc-b91/solaris/bin/java Test
No NPE.
======================================================================
xxxxx@xxxxx 2004-09-14
|
|
Evaluation
|
^C
xxxxx@xxxxx 2002-05-28
The analysis is correct
xxxxx@xxxxx 2003-07-23
New specification through CCC is
/**
* Create a named Level with a given integer value and a
* given localization resource name.
* <p>
* @param name the name of the Level, for example "SEVERE".
* @param value an integer value for the level.
* @param resourceBundleName name of a resource bundle to use in
* localizing the given name (may be null).
* @throws NullPointerException if the name is null
*/
protected Level(String name, int value, String resourceBundleName) {
xxxxx@xxxxx 2003-09-09
|