-
Bug
-
Resolution: Future Project
-
P3
-
6
-
generic
-
generic
Problem description:
====================
The following constructors in the javax.xml.stream.XMLStreamException class
XMLStreamException(String msg, Location location)
XMLStreamException(String msg, Location location, Throwable th)
throw NullPointerException when location is null, but do not document such behaviour.
Minimized test:
===============
-- Test.java --
import javax.xml.stream.*;
public class Test {
public static void main(String[] args) {
XMLStreamException obj = null;
try {
System.out.println(
"Check XMLStreamException(String msg, Location location)");
obj = new XMLStreamException("msg", (Location) null);
System.out.println("PASSED");
} catch (NullPointerException npe) {
System.out.println(
"FAILED. Unexpected NullPointerException is thrown");
}
try {
System.out.println(
"Check XMLStreamException(String msg, Location location, Throwable th)");
obj = new XMLStreamException(
"msg", (Location) null, new Throwable());
System.out.println("PASSED");
} catch (NullPointerException npe) {
System.out.println(
"FAILED. Unexpected NullPointerException is thrown");
}
}
}
-- End of Test.java --
Minimized test output:
======================
$java -showversion Test
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
Check XMLStreamException(String msg, Location location)
FAILED. Unexpected NullPointerException is thrown
Check XMLStreamException(String msg, Location location, Throwable th)
FAILED. Unexpected NullPointerException is thrown
====================
The following constructors in the javax.xml.stream.XMLStreamException class
XMLStreamException(String msg, Location location)
XMLStreamException(String msg, Location location, Throwable th)
throw NullPointerException when location is null, but do not document such behaviour.
Minimized test:
===============
-- Test.java --
import javax.xml.stream.*;
public class Test {
public static void main(String[] args) {
XMLStreamException obj = null;
try {
System.out.println(
"Check XMLStreamException(String msg, Location location)");
obj = new XMLStreamException("msg", (Location) null);
System.out.println("PASSED");
} catch (NullPointerException npe) {
System.out.println(
"FAILED. Unexpected NullPointerException is thrown");
}
try {
System.out.println(
"Check XMLStreamException(String msg, Location location, Throwable th)");
obj = new XMLStreamException(
"msg", (Location) null, new Throwable());
System.out.println("PASSED");
} catch (NullPointerException npe) {
System.out.println(
"FAILED. Unexpected NullPointerException is thrown");
}
}
}
-- End of Test.java --
Minimized test output:
======================
$java -showversion Test
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
Check XMLStreamException(String msg, Location location)
FAILED. Unexpected NullPointerException is thrown
Check XMLStreamException(String msg, Location location, Throwable th)
FAILED. Unexpected NullPointerException is thrown