[
https://issues.apache.org/jira/browse/IO-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17730549#comment-17730549
]
Jan Høydahl commented on IO-800:
--------------------------------
My main concern is the unintendend change for a long-existing API, so it should
stay the same for the sake of back-compat. The unintendend change not only
affects deleteDirectory but all APIs using {{{}visitFileTree{}}}.
My proposed fix is revering the (unrelated) change in the commit referenced
above:
{code:java}
Index: src/main/java/org/apache/commons/io/file/PathUtils.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>ISO-8859-1
===================================================================
diff --git a/src/main/java/org/apache/commons/io/file/PathUtils.java
b/src/main/java/org/apache/commons/io/file/PathUtils.java
--- a/src/main/java/org/apache/commons/io/file/PathUtils.java (revision
d3910a914787db46207886bc6cd3c3ac803a4f76)
+++ b/src/main/java/org/apache/commons/io/file/PathUtils.java (date
1686228971841)
@@ -1650,7 +1650,6 @@
* @throws NullPointerException if the directory is {@code null}.
*/
public static <T extends FileVisitor<? super Path>> T visitFileTree(final
T visitor, final Path directory) throws IOException {
- requireExists(directory, "directory");
Files.walkFileTree(directory, visitor);
return visitor;
}
{code}
> Possible bug in PathUtils.deleteDirectory
> -----------------------------------------
>
> Key: IO-800
> URL: https://issues.apache.org/jira/browse/IO-800
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.12.0, 2.13.0
> Reporter: Jan Høydahl
> Priority: Major
>
> We are trying to upgrade Apache Solr from commons-io 2.11 to 2.13 in
> [https://github.com/apache/solr/pull/1653.] As you will see in the PR
> comments and also in the failed [test
> logs|https://github.com/apache/solr/actions/runs/5209945412/jobs/9400431409?pr=1653],
> a call to PathUtils.deleteDirectory on a non-existing directory, behaves
> differently between those versions.
> This looks like a regression related to refactoring of that method.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)