You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Jinmei Liao (JIRA)" <ji...@apache.org> on 2018/10/26 19:00:00 UTC

[jira] [Resolved] (GEODE-5892) File's absolute path does not change after user.dir is changed in jdk11

     [ https://issues.apache.org/jira/browse/GEODE-5892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jinmei Liao resolved GEODE-5892.
--------------------------------
    Resolution: Fixed

> File's absolute path does not change after user.dir is changed in jdk11
> -----------------------------------------------------------------------
>
>                 Key: GEODE-5892
>                 URL: https://issues.apache.org/jira/browse/GEODE-5892
>             Project: Geode
>          Issue Type: Sub-task
>            Reporter: Jinmei Liao
>            Assignee: Jinmei Liao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> {noformat}
> File relativeFile1 = new File("abc.txt");
> System.setProperty("user.dir", "/somewhereElse");
> File relativeFile2 = new File("abc.txt");
> System.out.println(relativeFile1.getAbsolutePath());
> System.out.println(relativeFile2.getAbsolutePath());
> {noformat}
> pre jdk11, the code above will print out "/somewhereElse/abc.txt"  in both lines, even though the relativeFile objects still point to the files under the old user.dir. But in jdk11, the above code will print out "old user.dir/abc.txt" in both lines. 
> dynamically change user.dir would not affect the relative file's absolute path anymore.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)