Integrated: 8334900: IOOBE when adding data to a Series of a BarChart that already contains data

Markus Mack mmack at openjdk.org
Wed Aug 14 17:54:56 UTC 2024


On Mon, 24 Jun 2024 22:10:38 GMT, Markus Mack <mmack at openjdk.org> wrote:

> This PR is a fix for another IOOBE that I discovered while working on #1476.
> 
> The PR simplifies the code for adding a series that already contains data by adding the data points one-by-one.
> As far as I can see no attempt was previously made to optimize the bulk operation except for some trivial O(1) operations, so this should have no noticable performance impact.
> 
> Accidentally this fixes another bug related to the missing "negative" style class when negative data values are added.
> 
> Also, the PR aligns the handling of duplicate categories with the behavior clarified in #1476, when there are duplicates in the data that was already in the series before the series was added to the chart.
> 
> Note a change was made to the createTestSeries() test method, letting it start at index 1, avoiding the duplicate data items resulting from multiplying by 0.
> Without this change `testSeriesRemoveAnimatedStyleClasses` would fail because it counts the number of plot children, where the duplicates are now removed.

This pull request has now been integrated.

Changeset: 338b1f3a
Author:    Markus Mack <mmack at openjdk.org>
Committer: Michael Strauß <mstrauss at openjdk.org>
URL:       https://git.openjdk.org/jfx/commit/338b1f3a1cff64f8eceb140015fec232f21234eb
Stats:     125 lines in 2 files changed: 94 ins; 28 del; 3 mod

8334900: IOOBE when adding data to a Series of a BarChart that already contains data
8334901: Style class "negative" is not always added for new BarChart data with negative value

Reviewed-by: mstrauss, angorya

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

PR: https://git.openjdk.org/jfx/pull/1488


More information about the openjfx-dev mailing list