henricook commented on PR #394:
URL: https://github.com/apache/commons-email/pull/394#issuecomment-3885367787

   > The tests that fail in Java 25 and 26 have code like the following:
   > 
   > ```java
   > // test bad file
   > attachment.setPath("");
   > ```
   > 
   > Maybe an empty Path is now allowed?
   
   I think that File("") has different semantics in Java 25. Rather than being 
`false` it is the primary working directory. Here's an example. Which means 
this test is probably failing on main? Is there a scheduled run of tests on 
main or similar I could check? Or I could open a new PR with no changes.
   
   ```
   echo 'System.out.println("Java " + System.getProperty("java.version") + ": 
new File(\"\").exists() = " + new java.io.File("").exists());' | docker run 
--rm -i eclipse-temurin:21-jdk jshell -s -                                      
    
      
   echo 'System.out.println("Java " + System.getProperty("java.version") + ": 
new File(\"\").exists() = " + new java.io.File("").exists());' | docker run 
--rm -i eclipse-temurin:25-jdk jshell -s -  
   ```
   
   gives:
   
   ```
   ~ ❯ echo 'System.out.println("Java " + System.getProperty("java.version") + 
": new File(\"\").exists() = " + new java.io.File("").exists());' | docker run 
--rm -i eclipse-temurin:21-jdk jshell -s -
   Feb 11, 2026 3:58:08 PM java.util.prefs.FileSystemPreferences$1 run
   INFO: Created user preferences directory.
   Java 21.0.10: new File("").exists() = false
   
   ~ ❯ echo 'System.out.println("Java " + System.getProperty("java.version") + 
": new File(\"\").exists() = " + new java.io.File("").exists());' | docker run 
--rm -i eclipse-temurin:25-jdk jshell -s -
   Feb 11, 2026 3:58:24 PM java.util.prefs.FileSystemPreferences setupUserRoot
   INFO: Created user preferences directory.
   Java 25.0.2: new File("").exists() = true
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to