Commit 50e7ddd
Reject
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: 370516874null in CharStreams.asWriter(appendable).write(string[, ...]).1 parent 38112eb commit 50e7ddd
File tree
2 files changed
+8
-4
lines changed- android/guava/src/com/google/common/io
- guava/src/com/google/common/io
2 files changed
+8
-4
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
0 commit comments