Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8370216

Fix of new File("").exists() causes undefined behavior in libraries

XMLWordPrintable

      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



       

            rkale Raghu Kale
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: