Skip to content

Commit 9449d38

Browse files
nick-someoneError Prone Team
authored and
Error Prone Team
committed
Add the SSTable to the CIRV stats collector.
Tested with a local run: https://screenshot.googleplex.com/BKMXArP7HX9ooGD PiperOrigin-RevId: 464626829
1 parent 173b0ed commit 9449d38

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

core/src/main/java/com/google/errorprone/bugpatterns/checkreturnvalue/ExternalCanIgnoreReturnValue.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import com.sun.tools.javac.util.List;
3838
import java.io.IOException;
3939
import java.io.UncheckedIOException;
40-
import java.nio.file.Path;
4140
import java.nio.file.Paths;
4241
import java.util.Optional;
4342
import java.util.stream.Stream;
@@ -92,26 +91,25 @@ interface MethodPredicate {
9291
enum ConfigParser {
9392
AS_STRINGS {
9493
@Override
95-
MethodPredicate load(Path file) throws IOException {
96-
return configByInterpretingMethodsAsStrings(MoreFiles.asCharSource(file, UTF_8));
94+
MethodPredicate load(String file, ErrorProneFlags flags) throws IOException {
95+
return configByInterpretingMethodsAsStrings(MoreFiles.asCharSource(Paths.get(file), UTF_8));
9796
}
9897
},
9998
PARSE_TOKENS {
10099
@Override
101-
MethodPredicate load(Path file) throws IOException {
102-
return configByParsingApiObjects(MoreFiles.asCharSource(file, UTF_8));
100+
MethodPredicate load(String file, ErrorProneFlags flags) throws IOException {
101+
return configByParsingApiObjects(MoreFiles.asCharSource(Paths.get(file), UTF_8));
103102
}
104103
};
105104

106-
abstract MethodPredicate load(Path file) throws IOException;
105+
abstract MethodPredicate load(String file, ErrorProneFlags flags) throws IOException;
107106
}
108107

109108
private static MethodPredicate loadConfigListFromFile(String filename, ErrorProneFlags flags) {
110109
ConfigParser configParser =
111110
flags.getEnum(EXCLUSION_LIST_PARSER, ConfigParser.class).orElse(ConfigParser.AS_STRINGS);
112111
try {
113-
Path file = Paths.get(filename);
114-
return configParser.load(file);
112+
return configParser.load(filename, flags);
115113
} catch (IOException e) {
116114
throw new UncheckedIOException(
117115
"Could not load external resource for CanIgnoreReturnValue", e);

0 commit comments

Comments
 (0)