|
37 | 37 | import com.sun.tools.javac.util.List;
|
38 | 38 | import java.io.IOException;
|
39 | 39 | import java.io.UncheckedIOException;
|
40 |
| -import java.nio.file.Path; |
41 | 40 | import java.nio.file.Paths;
|
42 | 41 | import java.util.Optional;
|
43 | 42 | import java.util.stream.Stream;
|
@@ -92,26 +91,25 @@ interface MethodPredicate {
|
92 | 91 | enum ConfigParser {
|
93 | 92 | AS_STRINGS {
|
94 | 93 | @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)); |
97 | 96 | }
|
98 | 97 | },
|
99 | 98 | PARSE_TOKENS {
|
100 | 99 | @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)); |
103 | 102 | }
|
104 | 103 | };
|
105 | 104 |
|
106 |
| - abstract MethodPredicate load(Path file) throws IOException; |
| 105 | + abstract MethodPredicate load(String file, ErrorProneFlags flags) throws IOException; |
107 | 106 | }
|
108 | 107 |
|
109 | 108 | private static MethodPredicate loadConfigListFromFile(String filename, ErrorProneFlags flags) {
|
110 | 109 | ConfigParser configParser =
|
111 | 110 | flags.getEnum(EXCLUSION_LIST_PARSER, ConfigParser.class).orElse(ConfigParser.AS_STRINGS);
|
112 | 111 | try {
|
113 |
| - Path file = Paths.get(filename); |
114 |
| - return configParser.load(file); |
| 112 | + return configParser.load(filename, flags); |
115 | 113 | } catch (IOException e) {
|
116 | 114 | throw new UncheckedIOException(
|
117 | 115 | "Could not load external resource for CanIgnoreReturnValue", e);
|
|
0 commit comments