RFR: 8088923: IOOBE when adding duplicate categories to the BarChart [v5]

Andy Goryachev angorya at openjdk.org
Mon Jun 24 15:01:21 UTC 2024


On Sat, 22 Jun 2024 10:55:28 GMT, Markus Mack <mmack at openjdk.org> wrote:

>> This PR provides the test case given in the JBS issue, and a simple fix for the index calculation when inserting data after previous data with duplicate categories.
>> 
>> Also, I've added a comment to `BarChart`s javadoc, clarifying the behavior that was apparently assumed (but broken) previously.
>> 
>> The index lookup is skipped for performance reasons if there are no duplicates, corresponding to the previous implementation.
>> Further optimizations would be possible, but probably are not really helpful without more extensive changes. The previous code already loops over all categories to check if they are present, typically nested in a loop adding many data items, thus already scaling quadratically when adding lots of mostly unique data points.
>
> Markus Mack has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add javadoc clarification

lgtm.

There is additional performance hit which I think is ok because javafx charts' design is not suitable for large amount of data points anyway.  A typical use of the chart is to render relatively few data points where the impact is minor.

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

Marked as reviewed by angorya (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/1476#pullrequestreview-2136063435


More information about the openjfx-dev mailing list