RFR: 8041331 Cleanup files for jtreg and windows

Stuart Marks stuart.marks at oracle.com
Tue Apr 22 01:26:44 UTC 2014

On 4/21/14 1:58 PM, Lance Andersen wrote:
> Need a reviewer for some additional updates of the SQLException tests I pushed on Friday so that they play nicer WRT clean up on windows with some tools.
> Did some minor refactoring as part of this to address some of Roger's earlier comments seeing I had to touch the tests.
> The webrev is at http://cr.openjdk.java.net/~lancea/8041331/webrev.00/

Hi Lance,

Thanks for pointing me at this webrev.

Extracting all the serialization/deserialization code into a helper method 
createSerializedException() makes good sense. Nice use of generics, too.

I'd go farther and avoid creating a file in the first place. You can serialize 
to a ByteArrayOutputStream, extract the byte array, and deserialize from that. 
It's probably necessary to flush between serialization and deserialization. This 
avoids having to do any file cleanup at all. (The IOExceptions still have to be 
handled or declared, though.)

You could go back and remove the fname argument from all callers, or you could 
leave it in as a label to use in messages if any error occurs in this routine.

One tiny nitpick, at SQLNonTransientConnectionExceptionTests.java line 170, an 
extra semicolon was inserted.



More information about the core-libs-dev mailing list