[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-runtime-dev
Subject:    Re: RFR(S) 8165603 - UseAppCDS.java failed to clean up files after test
From:       Mikhailo Seledtsov <mikhailo.seledtsov () oracle ! com>
Date:       2017-12-13 1:58:09
Message-ID: 5A308931.8050605 () oracle ! com
[Download RAW message or body]

+1

Misha

On 12/12/17, 5:28 PM, David Holmes wrote:
> Looks good! Nice cleanup.
>
> Thanks,
> David
>
> On 13/12/2017 10:41 AM, Ioi Lam wrote:
>> https://bugs.openjdk.java.net/browse/JDK-8165603
>> http://cr.openjdk.java.net/~iklam/jdk11/8165603-files-not-closed.v01/
>>
>> Summary:
>>
>> The test case opens a temp file for reading without closing it 
>> explicitly. This causes
>> jtreg agentvm mode testing on Windows to complain about failing to 
>> delete the temp file.
>>
>> The fix is to to put the opening of input/output streams in 
>> try-resource blocks, like
>>
>>    try (BufferedReader br =
>>         new BufferedReader(
>>           new InputStreamReader(
>>            new FileInputStream(filename)))
>>    ) {
>>       for (; ; ) {
>>         String line = br.readLine();
>>       ...
>>    }
>>
>> The streams will be closed when we leave the "try" block.
>>
>> Besides the test in the bug report, I fixed a few other files in 
>> similar ways.
>>
>> Testing -- HotSpot tier1/tier2 tests all passed. I verified that 
>> UseAppCDS.java
>> is now executed on Windows and passed.
>>
>> I plan to push into the jdk/hs repo after the jdk 10 repo fork.
>>
>> Thanks
>> - Ioi
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic