Details
-
Bug
-
Resolution: Fixed
-
P3
-
repo-loom
Description
=== java.io =====
Unless otherwise noted, passing a null argument to a constructor or method in any class or interface in this package will cause a NullPointerException to be thrown.
========
Code sample
new java.io.PrintWriter((java.io.Writer)null, false);
doesn't produce NPE with the JDK-loom implementation.
The change in behavior is likely caused by https://github.com/openjdk/loom/commit/20d1240b2e4e233549fd057149b6cec7bc2cc14a#diff-59afb0eab27ce903c9507c69b41a224dd3d121797d32ad4bd5d832d66d72d139L115
While JDK-mainline generates:
Exception in thread "main" java.lang.NullPointerException
at java.base/java.io.Writer.<init>(Writer.java:174)
at java.base/java.io.PrintWriter.<init>(PrintWriter.java:112)
at Test.main(Test.java:3)
Unless otherwise noted, passing a null argument to a constructor or method in any class or interface in this package will cause a NullPointerException to be thrown.
========
Code sample
new java.io.PrintWriter((java.io.Writer)null, false);
doesn't produce NPE with the JDK-loom implementation.
The change in behavior is likely caused by https://github.com/openjdk/loom/commit/20d1240b2e4e233549fd057149b6cec7bc2cc14a#diff-59afb0eab27ce903c9507c69b41a224dd3d121797d32ad4bd5d832d66d72d139L115
While JDK-mainline generates:
Exception in thread "main" java.lang.NullPointerException
at java.base/java.io.Writer.<init>(Writer.java:174)
at java.base/java.io.PrintWriter.<init>(PrintWriter.java:112)
at Test.main(Test.java:3)