<Swing Dev> [9] Review request for 8074956: ArrayIndexOutOfBoundsException in javax.swing.text.html.parser.ContentModel.first()

Alexey Ivanov alexey.ivanov at oracle.com
Mon Apr 13 13:34:11 UTC 2015


Hello Swing team,

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

Description:
Implementation of ContentModel.first(Element) uses cache for elements. 
It is implied all the possible elements are already created before you 
call first(Element) method for the first time. If you create a new 
Element instance and call first(Element) method with it, you'll get 
ArrayIndexOutOfBoundsException because the implication is now false.

The fix is to re-create arrays used for cache when an "unknown" Element 
is used as parameter to first(Element).

Thanks,
Alexey



More information about the swing-dev mailing list