[OpenJDK 2D-Dev] [9] Review Request: 8042103 Deserialization of empty java.awt.geom.Path2D will cause an exception

Jim Graham james.graham at oracle.com
Thu May 1 00:44:38 UTC 2014


Hi Sergey,

I think the bug is in the readObject routine.  It sets the initial size 
of the arrays based on if the number of segments/coords is "< 0" and it 
sets them to INIT_SIZE or INIT_SIZE*2 accordingly.  Those tests should 
be "< INIT_SIZE(*2)"...

			...jim

On 4/30/14 8:52 AM, Sergey Bylokhov wrote:
> Hello.
> Please review the fix for jdk 9.
> needRoom() method does not take into account that current array of types
> can be empty. In this case it fails to increase it.
> I handle this case and increase the size of the array by 1 instead of
> INIT_SIZE, because I assume that the user intentionally try to decrease
> memory usage.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8042103
> Webrev can be found at: http://cr.openjdk.java.net/~serb/8042103/webrev.00
>



More information about the 2d-dev mailing list