RFR: 8088923: IOOBE when adding duplicate categories to the BarChart

Andy Goryachev angorya at openjdk.org
Thu Jun 20 16:55:17 UTC 2024


On Thu, 20 Jun 2024 16:50:23 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> modules/javafx.controls/src/main/java/javafx/scene/chart/BarChart.java line 215:
>> 
>>> 213:         if (!categoryAxis.getCategories().contains(category)) {
>>> 214:             // find category index in case data contains duplicate categories
>>> 215:             int i = series.getData().size() != categoryAxis.getCategories().size() ? series.getItemIndex(item) :
>> 
>> this is clever: little impact on performance in the case of non-duplicate categories (the most common case).
>
> However, I don't see the issue if I just add a duplicate data point after the chart is rendered (the code jumps to line 218 in the master branch).
> 
> This makes me think that perhaps the fix should include fixing the logic of adding category to the right hashtables at the right moment.  What do you think?

I've added a popup menu on the BarChart page in the Monkey Tester to test the case ...
https://github.com/andy-goryachev-oracle/MonkeyTest

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1476#discussion_r1647871163


More information about the openjfx-dev mailing list