-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: 25
-
Component/s: core-libs
-
In Review
A DESCRIPTION OF THE PROBLEM :
in former JDKs up to JDK-24 the statement 'new File("").exists()' return false
In JDK-25 it returns true.
https://bugs.openjdk.org/browse/JDK-8024695
This could cause an undefined behavior in libraries and the use of JDK-25 is now a risk
Suggestion:
deprecate exists() and make a new method e.g. itExists(), isExistent()
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
new File("").exists() in JDK 24 returns false
new File("").exists() in JDK 25 returns true
in former JDKs up to JDK-24 the statement 'new File("").exists()' return false
In JDK-25 it returns true.
https://bugs.openjdk.org/browse/JDK-8024695
This could cause an undefined behavior in libraries and the use of JDK-25 is now a risk
Suggestion:
deprecate exists() and make a new method e.g. itExists(), isExistent()
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
new File("").exists() in JDK 24 returns false
new File("").exists() in JDK 25 returns true
- caused by
-
JDK-8024695 new File("").exists() returns false whereas it is the current working directory
-
- Resolved
-
- csr for
-
JDK-8371422 Fix of new File("").exists() causes undefined behavior in libraries
-
- Provisional
-
- duplicates
-
JDK-8371214 File.exists() method returns true on Java 25, false on Java 24 and before
-
- Closed
-
-
JDK-8371217 The empty path (for the current directory) now exists
-
- Closed
-
-
JDK-8371127 File("").exists() change breaks legacy apps
-
- Closed
-
- links to
-
Review(master)
openjdk/jdk/28158
(2 links to)