-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
7
-
x86
-
windows_7
A DESCRIPTION OF THE PROBLEM :
It is unspecified what happens when name is null.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
getLogger is the companion to addLogger so it should be similar:
http://download.oracle.com/javase/7/docs/api/java/util/logging/LogManager.html#addLogger(java.util.logging.Logger)
"Throws:
NullPointerException - if the logger name is null."
ACTUAL -
No throws section but the current implementation throws a NPE:
public class Main {
public static void main(String[] args) {
java.util.logging.LogManager.getLogManager().getLogger(null);
}
}
=>
Exception in thread "main" java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:334)
at java.util.logging.LogManager.getLogger(LogManager.java:558)
at Main.main(Main.java:7)
URL OF FAULTY DOCUMENTATION :
http://download.oracle.com/javase/7/docs/api/java/util/logging/LogManager.html#getLogger(java.lang.String)
It is unspecified what happens when name is null.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
getLogger is the companion to addLogger so it should be similar:
http://download.oracle.com/javase/7/docs/api/java/util/logging/LogManager.html#addLogger(java.util.logging.Logger)
"Throws:
NullPointerException - if the logger name is null."
ACTUAL -
No throws section but the current implementation throws a NPE:
public class Main {
public static void main(String[] args) {
java.util.logging.LogManager.getLogManager().getLogger(null);
}
}
=>
Exception in thread "main" java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:334)
at java.util.logging.LogManager.getLogger(LogManager.java:558)
at Main.main(Main.java:7)
URL OF FAULTY DOCUMENTATION :
http://download.oracle.com/javase/7/docs/api/java/util/logging/LogManager.html#getLogger(java.lang.String)