Hi Alan The method you propose: [nio.]Files[.write](aFile.toPath, lines) adds a trailing blank line to the file; the regression test needs to generate a file without a trailing blank line as this is the condition in which the bug occurs. This is why it now writes out an array of bytes
Cheers Mat ________________________________ From: core-libs-dev <core-libs-dev-boun...@openjdk.java.net> on behalf of Alan Bateman <alan.bate...@oracle.com> Sent: Friday, November 8, 2019 2:56 AM To: Henry Jen <henry....@oracle.com>; core-libs-dev@openjdk.java.net <core-libs-dev@openjdk.java.net> Subject: Re: RFR: 8231863: Crash if classpath is read from @argument file and the main gets option argument On 07/11/2019 22:55, Henry Jen wrote: > Hi, > > Please review the webrev[1], contributed by Mat Carter. You can find the bug > details at JBS[2]. I have reviewed and tested the fix, I still need an > official review before I can push this. > Looks okay although in the test, the createAFile helper method could be replaced with Files(aFile.toPath, lines) and that would avoid the need to concatenate all the lines. You can specify the defaultCharset to that method if you need really it. -Alan