Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bug in XSSFTable.setCellReferences when table is single cell #164

Closed
wants to merge 2 commits into from

Conversation

@travisrussell
Copy link

travisrussell commented Dec 5, 2019

Calling XSSFTable.setCellReferences throws an ArrayIndexOutOfBoundsException in the case when the table is only one cell.

XSSFTable.setCellReferences sets the table's startCellReference and endCellReference.
It fails because it expects a colon in the table reference, but in the one cell case there is no colon. In this case, it is simply a single cell, e.g., A2. This causes the exception to be thrown when setting the endCellReference, as the code expects a second part of the table reference.

This fix is to check the parts after we split the reference. If there is only one part, set the end reference to the same value as the start reference.

@asf-ci

This comment has been minimized.

Copy link

asf-ci commented Dec 5, 2019

Can one of the admins verify this patch?

@asfgit asfgit closed this in f12a414 Dec 11, 2019
asfgit pushed a commit that referenced this pull request Dec 11, 2019
…gle cell. Thanks to Travis Russell. This closes #164

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1871185 13f79535-47bb-0310-9956-ffa450edef68
@pjfanning

This comment has been minimized.

Copy link
Contributor

pjfanning commented Dec 11, 2019

merged using f12a414 and 4c034f0

Alain-Bearez pushed a commit to cuali/poi that referenced this pull request Dec 12, 2019
…gle cell. Thanks to Travis Russell. This closes apache#164

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1871184 13f79535-47bb-0310-9956-ffa450edef68
Alain-Bearez pushed a commit to cuali/poi that referenced this pull request Dec 12, 2019
…gle cell. Thanks to Travis Russell. This closes apache#164

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1871185 13f79535-47bb-0310-9956-ffa450edef68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.