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

File.getCanonicalPath should remove "(on UNIX platforms)" from its specification

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 25
    • core-libs
    • None
    • behavioral
    • minimal
    • This change aligns the specification with the behavior since JDK 24.
    • Java API
    • SE

      Summary

      Remove the statement "(on UNIX platforms)" from the specification of java.io.File.getCanonicalPath.

      Problem

      After JDK-8003887, this method now resolves symbolic links on Windows as well, so the parenthetical statement is no longer applicable.

      Solution

      Remove "(on UNIX platforms)" from the specification of File.getCanonicalPath.

      Specification

      --- a/src/java.base/share/classes/java/io/File.java
      +++ b/src/java.base/share/classes/java/io/File.java
      @@ -588,8 +588,8 @@ public File getAbsoluteFile() {
            * {@link #getAbsolutePath} method, and then maps it to its unique form in a
            * system-dependent way.  This typically involves removing redundant names
            * such as {@code "."} and {@code ".."} from the pathname, resolving
      -     * symbolic links (on UNIX platforms), and converting drive letters to a
      -     * standard case (on Microsoft Windows platforms).
      +     * symbolic links, and converting drive letters to a standard case (on
      +     * Microsoft Windows platforms).
            *
            * <p> Every pathname that denotes an existing file or directory has a
            * unique canonical form.  Every pathname that denotes a nonexistent file

            bpb Brian Burkhalter
            bpb Brian Burkhalter
            Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: