-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b02
The jdk.internal.http.common.Utils class exposes methods that work on lists or arrays of byte buffers, and tell whether or how much remaining data is present in the buffers in the list/array. These methods currently throw NullPointerException if the given list/buffer is null.
This is not in itself an issue, except that these methods are often called in debug statements, or in assert statements, where NullPointerException are not expected and should not be thrown.
One such assert statement in ResponseSubscribers hides a bug where the NullPointerException should always be thrown, but is in fact only thrown if asserts are enabled.
It would be better if these methods in Utils allowed null parameter, returning false or 0 when a null list or array is given.
This is not in itself an issue, except that these methods are often called in debug statements, or in assert statements, where NullPointerException are not expected and should not be thrown.
One such assert statement in ResponseSubscribers hides a bug where the NullPointerException should always be thrown, but is in fact only thrown if asserts are enabled.
It would be better if these methods in Utils allowed null parameter, returning false or 0 when a null list or array is given.