On 2025-06-26, Jaikiran Pai wrote:

> However on Windows we are seeing a large number of test failures. I
> looked into those failures and those all relate to the "heads up"
> section in your mail about
> https://jdk.java.net/25/release-notes#JDK-8355954. In the Ant
> testsuite there are several tests which attempt a
> java.io.File.delete() on a read-only file. Until Java 25, that call
> would delete the file.

> As noted in the linked change, that's no longer the case by default in
> Java 25. I manually updated the Ant testsuite to set the newly
> introduced -Djdk.io.File.allowDeleteReadOnlyFiles system property to
> true and that got all those tests to pass on Windows too.

Maybe we should change the tests, rather than set the system property?

Is the file read-only on non-Windows platforms as well? To me the
description of the change doesn't say what the behavior is on other
platforms. Is Windows the only one that now will not delete read-only
files - or is it the only one where read-only files would have been
removed prior to Java 25?

Also we could modify FileUtils.tryHardToDelete to remove the read-only
flag if we feel this is something that may hit Ant's users. After all it
has bitten our own testsuite.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to