IO-665 ensure that passing a null InputStream results in NPE with tests#112
Conversation
garydgregory
left a comment
There was a problem hiding this comment.
Could other constructors benefit from this check?
|
The other contructors, already throw the NPE so I didn't change them. We could add the check to ensure that thread is always a message though. |
|
Actually, since they use
Do you have a preference in that area? They behave correctly, but there is no message. |
I do not see why you'd need anything more than changing methods like: to: |
|
That is because you @garydgregory know java better than I lol. Will do |
|
@garydgregory done |
;-) |
…ts (apache#112) * ensure that passing a null InputStream results in NPE with tests * remove stray import from bad autocomplete * per review, fix formating for lamda () -> * per review, protect other constructors
This pr adds a null check for the InputStream constructor of XmlStreamReader. This makes it so that each contractor of type ( File, URL, URLConnection, InputStream ) throws NPE if passed a NULL for that type.
Tests were added as well for each type.
This change is