Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ public static String getRelativePath(String path) {

static Collection<File> getSortedFilesOf(File root, Collection<String> paths, boolean debug) {
Object2IntLinkedOpenHashMap<File> files = new Object2IntLinkedOpenHashMap<>();
String separator = File.separatorChar == '\\' ? "\\\\" : File.separator;

for (String path : paths) {
File rootFile = new File(root, path);
Expand All @@ -155,7 +154,7 @@ static Collection<File> getSortedFilesOf(File root, Collection<String> paths, bo
}
// if we are looking at a specific file, we don't want that to be overridden.
// otherwise, we want to use the specificity based on the number of file separators.
int pathSize = StringUtils.countMatches(path, separator);
int pathSize = StringUtils.countMatches(rootFile.getPath(), File.separatorChar);
try (Stream<Path> stream = Files.walk(rootFile.toPath(), debug ? FOLLOW_LINKS : NO_VISIT_OPTIONS)) {
stream.filter(path1 -> isGroovyFile(path1.toString()))
.map(Path::toFile)
Expand Down