Name: sdR10048 Date: 01/18/2002
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.
======================================================================
###@###.### 2004-09-14