{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/openj9/issues/1563","repository_url":"https://api.github.com/repos/eclipse/openj9","labels_url":"https://api.github.com/repos/eclipse/openj9/issues/1563/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/openj9/issues/1563/comments","events_url":"https://api.github.com/repos/eclipse/openj9/issues/1563/events","html_url":"https://github.com/eclipse/openj9/issues/1563","id":309336683,"number":1563,"title":"Created files have a filename of only the first requested character","user":{"login":"ben-walsh","id":23211844,"avatar_url":"https://avatars3.githubusercontent.com/u/23211844?v=4","gravatar_id":"","url":"https://api.github.com/users/ben-walsh","html_url":"https://github.com/ben-walsh","followers_url":"https://api.github.com/users/ben-walsh/followers","following_url":"https://api.github.com/users/ben-walsh/following{/other_user}","gists_url":"https://api.github.com/users/ben-walsh/gists{/gist_id}","starred_url":"https://api.github.com/users/ben-walsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ben-walsh/subscriptions","organizations_url":"https://api.github.com/users/ben-walsh/orgs","repos_url":"https://api.github.com/users/ben-walsh/repos","events_url":"https://api.github.com/users/ben-walsh/events{/privacy}","received_events_url":"https://api.github.com/users/ben-walsh/received_events","type":"User","site_admin":false},"labels":[{"id":697961487,"url":"https://api.github.com/repos/eclipse/openj9/labels/jdk10","name":"jdk10","color":"d93f0b","default":false},{"id":790051174,"url":"https://api.github.com/repos/eclipse/openj9/labels/test%20failure","name":"test failure","color":"ce2e0e","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-28T12:00:15Z","updated_at":"2018-03-28T13:26:09Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"When a file is created, it has a filename which is only the first character of the string specified.\r\nThis simple test shows the problem ...\r\n\r\n```\r\nimport java.io.*;\r\n\r\npublic class WriteFile {\r\n\r\n    public static void main(String[] args) {\r\n\r\n        try {\r\n\r\n            File out = new File(\"ABC.txt\");\r\n\r\n            out.createNewFile();\r\n\r\n            System.out.println(\"absolutePath() : \" + out.getAbsolutePath());\r\n\r\n        } catch (Exception e) {\r\n\r\n            System.out.println(e);\r\n\r\n        }\r\n\r\n   }\r\n\r\n}\r\n```\r\n\r\n... when it is compiled and run, the file that is created has a filename of \"A\" rather than the expected \"ABC.txt\" ...\r\n\r\n```\r\nwalshbp@bendev:~$ ls -ltr | tail\r\n-rw-rw-r--  1 walshbp walshbp 199595468 Mar 22 13:01 OpenJDK9-OPENJ9_x64_Win_20182203.zip\r\n-rwxrwxrwx  1 walshbp walshbp      5021 Mar 22 14:04 openjdk_notes.txt\r\n-rw-rw-r--  1 walshbp walshbp 200989495 Mar 28 10:37 brokenFileWrite.jdk.tar.gz\r\ndrwxrwxr-x 15 walshbp walshbp      4096 Mar 28 10:37 openjdk-openj9-internal-work\r\ndrwxrwxr-x 13 walshbp walshbp      4096 Mar 28 11:11 openjdk-openj9-jdk10-work\r\ndrwxrwxr-x  3 walshbp walshbp      4096 Mar 28 11:31 testOpenJDK9OpenJ9\r\ndrwxrwxr-x  3 walshbp walshbp      4096 Mar 28 11:45 testOpenJDK10OpenJ9\r\ndrwxrwxr-x  3 walshbp walshbp      4096 Mar 28 11:58 testOpenJDK10Hotspot\r\n-rw-rw-r--  1 walshbp walshbp       351 Mar 28 12:24 WriteFile.java\r\n-rw-rw-r--  1 walshbp walshbp      1143 Mar 28 12:24 WriteFile.class\r\nwalshbp@bendev:~$ ./testOpenJDK10OpenJ9/jdk-10+46/bin/java WriteFile\r\nabsolutePath() : /home/walshbp/ABC.txt\r\nwalshbp@bendev:~$ ls -ltr | tail\r\n-rwxrwxrwx  1 walshbp walshbp      5021 Mar 22 14:04 openjdk_notes.txt\r\n-rw-rw-r--  1 walshbp walshbp 200989495 Mar 28 10:37 brokenFileWrite.jdk.tar.gz\r\ndrwxrwxr-x 15 walshbp walshbp      4096 Mar 28 10:37 openjdk-openj9-internal-work\r\ndrwxrwxr-x 13 walshbp walshbp      4096 Mar 28 11:11 openjdk-openj9-jdk10-work\r\ndrwxrwxr-x  3 walshbp walshbp      4096 Mar 28 11:31 testOpenJDK9OpenJ9\r\ndrwxrwxr-x  3 walshbp walshbp      4096 Mar 28 11:45 testOpenJDK10OpenJ9\r\ndrwxrwxr-x  3 walshbp walshbp      4096 Mar 28 11:58 testOpenJDK10Hotspot\r\n-rw-rw-r--  1 walshbp walshbp       351 Mar 28 12:24 WriteFile.java\r\n-rw-rw-r--  1 walshbp walshbp      1143 Mar 28 12:24 WriteFile.class\r\n-rw-rw-r--  1 walshbp walshbp         0 Mar 28 12:58 A\r\nwalshbp@bendev:~$ ./testOpenJDK10OpenJ9/jdk-10+46/bin/java -version\r\nopenjdk version \"10-adoptopenjdk\" 2018-03-20\r\nOpenJDK Runtime Environment (build 10-adoptopenjdk+0-adhoc.jenkins.openjdk)\r\nEclipse OpenJ9 VM (build master-9adecd31, JRE 10 Linux amd64-64 Compressed References 20180327_9 (JIT enabled, AOT enabled)\r\nOpenJ9   - 9adecd31\r\nOMR      - a05605ea\r\nJCL      - f5e3d23b0f based on )\r\n```\r\nInternally, at the Java layer, the filename seems to be as requested.\r\n\r\nTried a range of builds ...\r\nlatest adoptopenjdk openjdk9 + openj9 build = filename as expected\r\nlatest adoptopenjdk openjdk10 + openj9 build = filename truncated to first character\r\nlatest external local openjdk10 + openj9 build = filename truncated to first character\r\nadoptopenjdk openjdk10 + hotspot = filename as expected\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/eclipse/openj9/issues/comments/376885703","html_url":"https://github.com/eclipse/openj9/issues/1563#issuecomment-376885703","issue_url":"https://api.github.com/repos/eclipse/openj9/issues/1563","id":376885703,"user":{"login":"pdbain-ibm","id":18007966,"avatar_url":"https://avatars1.githubusercontent.com/u/18007966?v=4","gravatar_id":"","url":"https://api.github.com/users/pdbain-ibm","html_url":"https://github.com/pdbain-ibm","followers_url":"https://api.github.com/users/pdbain-ibm/followers","following_url":"https://api.github.com/users/pdbain-ibm/following{/other_user}","gists_url":"https://api.github.com/users/pdbain-ibm/gists{/gist_id}","starred_url":"https://api.github.com/users/pdbain-ibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdbain-ibm/subscriptions","organizations_url":"https://api.github.com/users/pdbain-ibm/orgs","repos_url":"https://api.github.com/users/pdbain-ibm/repos","events_url":"https://api.github.com/users/pdbain-ibm/events{/privacy}","received_events_url":"https://api.github.com/users/pdbain-ibm/received_events","type":"User","site_admin":false},"created_at":"2018-03-28T13:26:09Z","updated_at":"2018-03-28T13:26:09Z","author_association":"CONTRIBUTOR","body":"Per discussion with @pshipton , I will investigate."}}
{"actor":{"display_login":"pdbain-ibm"}}