Fix AbstractScriptFileWatcher missing deletes on Windows (#3216)

Signed-off-by: Jan N. Klug <github@klug.nrw>
pull/3218/head
J-N-K 2022-12-11 16:11:53 +01:00 committed by GitHub
parent 5bb31074b5
commit 53861794de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -207,10 +207,10 @@ public abstract class AbstractScriptFileWatcher extends AbstractWatchService imp
if (file.isDirectory()) {
if (watchSubDirectories()) {
synchronized (this) {
String prefix = file.toString() + File.separator;
var toRemove = loaded.stream()
String prefix = file.toURI().toURL().getPath();
Set<ScriptFileReference> toRemove = loaded.stream()
.filter(f -> f.getScriptFileURL().getFile().startsWith(prefix))
.collect(Collectors.toList());
.collect(Collectors.toSet());
toRemove.forEach(this::removeFile);
}
}