<AWT Dev> [9] Review request for JDK-8059590: ArrayIndexOutOfBoundsException occurs when Container with overridden getComponents() is deserialized

Alexey Ivanov alexey.ivanov at oracle.com
Thu Oct 16 13:21:49 UTC 2014

Hello AWT Team,

Could you please review the fix for the bug:
     bug: https://bugs.openjdk.java.net/browse/JDK-8059590
     webrev: http://cr.openjdk.java.net/~aivanov/8059590/jdk9/webrev.00/

Problem description:
If one overrides getComponents() method of java.awt.Container to return 
an array of different size than the number of components in Container, 
ArrayIndexOutOfBoundsException could be thrown during deserialization. 
Container.writeObject() stores the number of components by accessing its 
list directly but stores the array of components that's returned by 
overridden getComponents() method.

Thank you in advance,

More information about the awt-dev mailing list