Skip to content

Fix ArrayIndexOutOfBoundsException exception in BarChartRenderer.java from bug #4984 - #4985

Closed
Athameon wants to merge 1 commit into
PhilJay:masterfrom
Athameon:patch-2
Closed

Athameon wants to merge 1 commit into
PhilJay:masterfrom
Athameon:patch-2

Conversation

@Athameon

Copy link
Copy Markdown

ArrayIndexOutOfBoundsException is thrown and whole app crashes if a a marked BarCharts get outside of the visible range.
The exception can be caught and logged without a disadvantage.

PR Checklist:

PR Description

The "e.getRanges()[high.getStackIndex()]" gets surrounded with a try - catch. If an exception is thrown, the method returns without any change.

Catches exception if a marked BarChart gets outside of the visible chart area.

The whole app crashes if this exception is not caught.

ArrayIndexOutOfBoundsException is thrown and whole app crashes if a a marked BarCharts get outside of the visible range.
@Athameon Athameon changed the title Update BarChartRenderer.java Fixe bug https://github.com/PhilJay/MPAndroidChart/issues/4984 in BarChartRenderer.java Aug 30, 2020
@Athameon Athameon changed the title Fixe bug https://github.com/PhilJay/MPAndroidChart/issues/4984 in BarChartRenderer.java Fixe bug ArrayIndexOutOfBoundsException exception in BarChartRenderer.java from bug #4984 Aug 30, 2020
@Athameon Athameon changed the title Fixe bug ArrayIndexOutOfBoundsException exception in BarChartRenderer.java from bug #4984 Fix ArrayIndexOutOfBoundsException exception in BarChartRenderer.java from bug #4984 Aug 30, 2020
@Athameon Athameon closed this Nov 14, 2020
@Athameon Athameon reopened this Nov 14, 2020
@PhilJay

PhilJay commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Thanks a lot for this pull request, and sorry it never got merged. MPAndroidChart 4.0.0 is a complete rewrite in Kotlin (https://github.com/PhilJay/MPAndroidChart/releases/tag/v4.0.0), so this change no longer applies to the code base and I am closing it. If it is still relevant for 4.0, a new pull request against master is very welcome. The Java 3.x code lives on in the 3.x branch.

@PhilJay PhilJay closed this Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants