Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0c7c914 authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Fix inconsistency in LoggingPrintStream.

LoggingPrintStream prints "null" for null strings from
print(String) but throws an NPE from println(String).

Fix this by delegating to the underlying builder (and avoiding
the "fast" path when the input String == null)

bug: https://code.google.com/p/android/issues/detail?id=63380
Change-Id: I89c5c12db6ed5af8037d46f67369b38c5b4cbc9f
parent 6e2d0c1d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ abstract class LoggingPrintStream extends PrintStream {

    @Override
    public synchronized void println(String s) {
        if (builder.length() == 0) {
        if (builder.length() == 0 && s != null) {
            // Optimization for a simple println.
            int length = s.length();