[jdk9] (XS) RFR: 8165243: Base64.Encoder.wrap(os).write(byte[], int, int) with incorrect arguments should not produce output

Alan Bateman Alan.Bateman at oracle.com
Fri Sep 2 14:51:34 UTC 2016


On 02/09/2016 09:59, Ivan Gerasimov wrote:

> :
>
>
> On 01.09.2016 20:39, Alan Bateman wrote:
>> TestBase64 is the unit test for this API, should the test be added to 
>> that instead?
>>
>
> Yes, it should be better.
>
> http://cr.openjdk.java.net/~igerasim/8165243/01/webrev/
>
> I also added another test case to make sure the decoder doesn't expose 
> the same bug.
> A cleanup pass was performed to make the code more compact.
>
> Is it good to go?
Using RandomFactory looks okay although more awkward to run the test 
standalone, I assume rnd should be final.

Since you changing a lot of usages then personally I have input stream 
named "in" rather than "is" easier to read.

I agree with Roger on making the exception messages clearer. A minor 
comment but the method names in the test are a bit inconsistent, 
"Encoder" vs "Enc" for example.

-Alan




More information about the core-libs-dev mailing list