Skip to content

Commit 334479c

Browse files
authored
Fix test args for SuggestedFixesTests (#1324)
Test-only cleanup change
1 parent 7923ea2 commit 334479c

2 files changed

Lines changed: 5 additions & 17 deletions

File tree

nullaway/src/main/java/com/uber/nullaway/generics/JSpecifyJavacConfig.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ public final class JSpecifyJavacConfig {
2323

2424
private JSpecifyJavacConfig() {}
2525

26-
/** Returns the compiler arguments required to enable JSpecify mode in tests. */
27-
public static List<String> jspecifyModeArgs() {
28-
return JSPECIFY_MODE_ARGS;
29-
}
30-
3126
/**
3227
* Returns a copy of {@code args} with the JSpecify-specific compiler arguments appended.
3328
*

nullaway/src/test/java/com/uber/nullaway/jspecify/SuggestedFixesTests.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.uber.nullaway.jspecify;
22

3+
import com.google.common.collect.ImmutableList;
34
import com.google.errorprone.BugCheckerRefactoringTestHelper;
45
import com.uber.nullaway.NullAway;
56
import com.uber.nullaway.generics.JSpecifyJavacConfig;
67
import java.io.IOException;
7-
import java.util.ArrayList;
88
import java.util.List;
99
import org.junit.Rule;
1010
import org.junit.Test;
@@ -17,21 +17,14 @@ public class SuggestedFixesTests {
1717

1818
private BugCheckerRefactoringTestHelper makeTestHelper() {
1919
List<String> args =
20-
new ArrayList<>(
20+
JSpecifyJavacConfig.withJSpecifyModeArgs(
2121
List.of(
2222
"-d",
2323
temporaryFolder.getRoot().getAbsolutePath(),
24-
"-processorpath",
25-
SuggestedFixesTests.class
26-
.getProtectionDomain()
27-
.getCodeSource()
28-
.getLocation()
29-
.getPath(),
30-
"-XepOpt:NullAway:AnnotatedPackages=com.uber"));
31-
args.addAll(JSpecifyJavacConfig.jspecifyModeArgs());
32-
args.add("-XepOpt:NullAway:SuggestSuppressions=true");
24+
"-XepOpt:NullAway:AnnotatedPackages=com.uber",
25+
"-XepOpt:NullAway:SuggestSuppressions=true"));
3326
return BugCheckerRefactoringTestHelper.newInstance(NullAway.class, getClass())
34-
.setArgs(args.toArray(new String[0]));
27+
.setArgs(ImmutableList.copyOf(args));
3528
}
3629

3730
@Test

0 commit comments

Comments
 (0)