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

Andy Goryachev angorya at openjdk.org
Fri Jun 21 23:08:16 UTC 2024


On Fri, 21 Jun 2024 22:10:42 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:
> 
>   testAddingDataAtIndex & fix

Found another problem.  It looks like it is present in the master branch, so this is a separate issue.  To reproduce with the Monkey Tester:

- select bar chart page
- right click, select "Add Series with Duplicate Category" twice
- click "Add Series" button on the right, under XY Chart
- resize the chart using the split pane on the right (or vertically)
The series added via context menu are not getting resized

This may or may not be related to https://bugs.openjdk.org/browse/JDK-8314754

![Screenshot 2024-06-21 at 15 59 15](https://github.com/openjdk/jfx/assets/107069028/6bfe3391-8af0-44cd-b961-5cf184b60040)

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

PR Comment: https://git.openjdk.org/jfx/pull/1476#issuecomment-2183563587


More information about the openjfx-dev mailing list