Change BuildOptions.DiffForReconstruction.toString() to use MoreObjects instead
of a StringBuilder.
package com.google.devtools.build.lib.analysis.config;
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableList;
@@ -617,11 +618,10 @@ public final class BuildOptions implements Cloneable, Serializable {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(differingOptions).append(System.lineSeparator());
- sb.append(extraFirstFragmentClasses).append(System.lineSeparator());
- sb.append(extraSecondFragments);
- return sb.toString();
+ return MoreObjects.toStringHelper(this)
+ .add("differingOptions", differingOptions)
+ .add("extraFirstFragmentClasses", extraFirstFragmentClasses)
+ .add("extraSecondFragments", extraSecondFragments).toString();
}
@Override
