Skip to content

Commit 069f863

Browse files
committed
Restore constructor and field used downstream
Partially reverts 032b0eb
1 parent 2a3d615 commit 069f863

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/org/openrewrite/java/testing/search/FindUnitTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.openrewrite.java.testing.search;
1717

1818
import lombok.Value;
19+
import org.jspecify.annotations.Nullable;
1920
import org.openrewrite.ExecutionContext;
2021
import org.openrewrite.Preconditions;
2122
import org.openrewrite.ScanningRecipe;
@@ -34,11 +35,16 @@
3435

3536
public class FindUnitTests extends ScanningRecipe<FindUnitTests.Accumulator> {
3637

38+
private transient @Nullable Accumulator acc = new Accumulator();
3739
transient FindUnitTestTable unitTestTable = new FindUnitTestTable(this);
3840

3941
public FindUnitTests() {
4042
}
4143

44+
public FindUnitTests(Accumulator acc) {
45+
this.acc = acc;
46+
}
47+
4248
@Override
4349
public String getDisplayName() {
4450
return "Find unit tests";
@@ -77,6 +83,7 @@ public static class AccumulatorValue {
7783

7884
@Override
7985
public Accumulator getInitialValue(ExecutionContext ctx) {
86+
if (acc != null) return acc;
8087
return new Accumulator();
8188
}
8289

0 commit comments

Comments
 (0)