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

Commit 0a4385e0 authored by François Degros's avatar François Degros
Browse files

Avoid calling some toString() methods directly

Let StringBuilder.append() do that in a way that does not throw any
NullPointerException if the passed object reference happens to be null.

Bug: 406328303
Flag: EXEMPT no functional change
Test: atest DocumentsUIGoogleTests:com.android.documentsui.services
Change-Id: I883d1f24e13678629300a537979830ccc82c1a69
parent f8aa9f65
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -103,8 +103,8 @@ public abstract class FileOperation implements Parcelable {

    private void appendInfoTo(StringBuilder builder) {
        builder.append("opType=").append(mOpType);
        builder.append(", srcs=").append(mSrcs.toString());
        builder.append(", destination=").append(mDestination.toString());
        builder.append(", srcs=").append(mSrcs);
        builder.append(", destination=").append(mDestination);
    }

    @Override
@@ -318,7 +318,7 @@ public abstract class FileOperation implements Parcelable {

            builder.append("MoveDeleteOperation{");
            super.appendInfoTo(builder);
            builder.append(", srcParent=").append(mSrcParent.toString());
            builder.append(", srcParent=").append(mSrcParent);
            builder.append("}");

            return builder.toString();