**[Jörg Kubitz](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER294220)** opened **[MSHARED-1122](https://issues.apache.org/jira/browse/MSHARED-1122?redirect=false)** and commented On JDK 11 the result has been cached with in JVM. Since JDK 12 the result is not cached anymore by default (See https://bugs.openjdk.java.net/browse/JDK-8207005) and now very slow on windows. For org.apache.maven.shared.utils.io.FileUtils.copyFile(File, File) please use java.nio.file.Files.isSameFile(Path, Path) instead. note: it's needed to call file.exists() before using Files.isSameFile() or catch NoSuchFileException `@see` https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/180308/10/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java for a similar fix. Here is a screenshot of sampling eclipse showing getCanonicalPath() as a hotspot: !image-2022-08-22-18-18-52-811.png! --- **Attachments:** - [image-2022-08-22-18-18-52-811.png](https://issues.apache.org/jira/secure/attachment/13048404/image-2022-08-22-18-18-52-811.png) (_59.70 kB_) **Remote Links:** - [GitHub Pull Request #114 ](https://github.com/apache/maven-shared-utils/pull/114) **Backported to:** [maven-shared-utils-3.4.0](https://github.com/apache/maven-shared-utils/milestone/18?closed=1)
Activity
jira-importer commentedon Aug 22, 2022
Jörg Kubitz commented
proposed fix tested with org.apache.maven.shared.utils.io.FileUtilsTest.copyFileWithNoFiltersAndLastModifiedDateOfZeroAndNoDestination()
jira-importer commentedon Sep 13, 2022
Slawomir Jaranowski commented
By the way
FileUtils#copyFileis deprecated ...