Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reject
null
in `CharStreams.asWriter(appendable).write(string[, ...…
…])`. This brings its behavior in line with other `Writer` implementations. Unfortunately, the docs don't describe this behavior: https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/io/Writer.html#write(java.lang.String) Note also that this behavior differs from the behavior of `Writer.append(null)`, which is to write the four characters "null." That behavior is itself poorly documented, since the docs for `append(CharSequence)` claim that it is equivalent to `out.write(csq.toString())`, which would throw NPE... though at least *that* is contradicted in the `@param` tag. (The difference between `write` and `append` presumably arises from inheriting `append` from the newer `Appendable` API.) RELNOTES=`io`: Changed `CharStreams.asWriter(appendable).write(string[, ...])` to reject a null `string`. PiperOrigin-RevId: 370516874
- Loading branch information