Skip to content

Commit 78003ba

Browse files
authored
Clean up bugpattern AutoValueSubclassLeaked (bazelbuild#647)
1 parent 5a0f148 commit 78003ba

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

javatests/io/bazel/rules/closure/worker/testing/ProgramResult.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.google.common.truth.FailureMetadata;
2222
import com.google.common.truth.Subject;
2323
import com.google.common.truth.Truth;
24-
import java.util.Arrays;
2524
import java.util.Set;
2625

2726
/** Result of program invocation. */
@@ -37,6 +36,10 @@ public abstract class ProgramResult {
3736
/** Returns {@code true} if program invocation failed. */
3837
public abstract boolean failed();
3938

39+
static ProgramResult create(Set<String> errors, Set<String> warnings, boolean failed) {
40+
return new AutoValue_ProgramResult(errors, warnings, failed);
41+
}
42+
4043
/** Begins a Truth assertion about a program invocation result. */
4144
public static ResultChain assertThat(ProgramResult result) {
4245
return Truth.assertAbout(SUBJECT_FACTORY).that(result);

javatests/io/bazel/rules/closure/worker/testing/ProgramRunner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ public final class ProgramRunner<T extends Program> {
3737
/** Runs program and returns result of invocation. */
3838
public ProgramResult run() throws Exception {
3939
delegate.run();
40-
return new AutoValue_ProgramResult(reporter.getErrors(), reporter.getWarnings(), failed.get());
40+
return ProgramResult.create(reporter.getErrors(), reporter.getWarnings(), failed.get());
4141
}
4242
}

0 commit comments

Comments
 (0)