diff --git a/tools/c-incremental/src/main/java/org/teavm/tooling/c/incremental/IncrementalCBuilder.java b/tools/c-incremental/src/main/java/org/teavm/tooling/c/incremental/IncrementalCBuilder.java index 3aa85865b..e2c3f0f89 100644 --- a/tools/c-incremental/src/main/java/org/teavm/tooling/c/incremental/IncrementalCBuilder.java +++ b/tools/c-incremental/src/main/java/org/teavm/tooling/c/incremental/IncrementalCBuilder.java @@ -249,6 +249,7 @@ public class IncrementalCBuilder { private List getChangedClasses(Collection changedFiles) { List result = new ArrayList<>(); + String[] prefixes = Arrays.stream(classPath).map(s -> s.replace('\\', '/')).toArray(String[]::new); for (File file : changedFiles) { String path = file.getPath().replace('\\', '/'); @@ -256,7 +257,7 @@ public class IncrementalCBuilder { continue; } - String prefix = Arrays.stream(classPath) + String prefix = Arrays.stream(prefixes) .filter(path::startsWith) .findFirst() .orElse(""); diff --git a/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java b/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java index acffed5da..248fb7855 100644 --- a/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java +++ b/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java @@ -907,6 +907,7 @@ public class CodeServlet extends HttpServlet { private List getChangedClasses(Collection changedFiles) { List result = new ArrayList<>(); + String[] prefixes = Arrays.stream(classPath).map(s -> s.replace('\\', '/')).toArray(String[]::new); for (File file : changedFiles) { String path = file.getPath().replace('\\', '/'); @@ -914,7 +915,7 @@ public class CodeServlet extends HttpServlet { continue; } - String prefix = Arrays.stream(classPath) + String prefix = Arrays.stream(prefixes) .filter(path::startsWith) .findFirst() .orElse("");