8000 Pull #16872: api: add new int process(List<Path> files) method to Roo… · Pankraz76/checkstyle@06d2051 · GitHub
[go: up one dir, main page]

Skip to content

Commit 06d2051

Browse files
author
Vincent Potucek
committed
Pull checkstyle#16872: api: add new int process(List<Path> files) method to RootModule - migrate old
1 parent 69b0cc2 commit 06d2051

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/com/puppycrawl/tools/checkstyle/Checker.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,17 @@ public void setBasedir(String basedir) {
212212

213213
@Override
214214
public int process(List<File> files) throws CheckstyleException {
215-
return processFilesInternal(files);
215+
return process(files.stream()
216+
.map(File::toPath)
217+
.collect(Collectors.toList()));
216218
}
217219

218220
@Override
219221
public int process(Collection<Path> paths) throws CheckstyleException {
220-
return processFilesInternal(paths.stream()
221-
.map(Path::toFile)
222-
.collect(Collectors.toUnmodifiableList()));
222+
return processPaths(paths);
223223
}
224224

225-
private int processFilesInternal(List<File> files) throws CheckstyleException {
225+
private int processPaths(Collection<Path> files) throws CheckstyleException {
226226
if (cacheFile != null) {
227227
cacheFile.putExternalResources(getExternalResourceLocations());
228228
}
@@ -234,6 +234,7 @@ private int processFilesInternal(List<File> files) throws CheckstyleException {
234234
}
235235

236236
processFiles(files.stream()
237+
.map(Path::toFile)
237238
.filter(file -> CommonUtil.matchesFileExtension(file, fileExtensions))
238239
.collect(Collectors.toUnmodifiableList()));
239240

0 commit comments

Comments
 (0)
0