8219196: DataOutputStream.writeUTF may throw unexpected exceptions

Brian Burkhalter brian.burkhalter at oracle.com
Fri Mar 22 20:46:30 UTC 2019


> On Mar 18, 2019, at 1:03 PM, Martin Buchholz <martinrb at google.com> wrote:
> 
> Below is another attempt at micro-optimization (might be too tricky!), BUT:

I like this version better and have updated the CR accordingly:

http://cr.openjdk.java.net/~bpb/8219196/webrev.02/

I refrained from doing a global replace of <code></code> => {@code } and @exception => @throws although it was tempting.

> - consider documenting the UTFDataFormatException and the 64k length limit

Done; will require a CSR.

> - error message would actually be more useful if it contained a few chars
> from head and tail instead of length


Done. I also changed the calculation of the length to use Integer.toUnsignedLong().

> On Mar 18, 2019, at 11:35 AM, Roger Riggs <Roger.Riggs at Oracle.com> wrote:
> 
> The test only needs enough memory to create the input string (MAXINT/3+1)
> and a bit more for the default sized ByteArrayOutputStream.
> So it should run in 2G configurations.

Fixed.

Thanks,

Brian


More information about the core-libs-dev mailing list