Don't evaluate JavaCompileAction#prettyPrint eagerly for rate-limited logging.
@@ -16,6 +16,7 @@ package com.google.devtools.build.lib.rules.java;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
+import static com.google.common.flogger.LazyArgs.lazy;
import static com.google.devtools.build.lib.actions.ActionAnalysisMetadata.mergeMaps;
import static java.nio.charset.StandardCharsets.ISO_8859_1;
import static java.util.concurrent.TimeUnit.SECONDS;
@@ -788,7 +789,8 @@ public final class JavaCompileAction extends AbstractAction implements CommandAc
}
logger.atInfo().atMostEvery(1, SECONDS).log(
- "Failed reduced classpath compilation for %s", JavaCompileAction.this.prettyPrint());
+ "Failed reduced classpath compilation for %s",
+ lazy(JavaCompileAction.this::prettyPrint));
// Fall back to running with the full classpath. This requires first deleting potential
// artifacts generated by the reduced action and clearing the metadata caches.
try {
