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

IndexOutOfBoundsException #42

Open
laeubi opened this issue Dec 8, 2022 · 2 comments
Open

IndexOutOfBoundsException #42

laeubi opened this issue Dec 8, 2022 · 2 comments

Comments

@laeubi
Copy link

laeubi commented Dec 8, 2022

Today I got an IOOB Exception, the code should either check for such condition and give meaningful error message if it is an user error or do not fail.

java.lang.IndexOutOfBoundsException: Index 135 out of bounds for length 135
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
	at java.base/java.util.Objects.checkIndex(Objects.java:359)
	at java.base/java.util.ArrayList.get(ArrayList.java:427)
	at de.vandermeer.asciithemes.TA_GridHelpers.adjustBorder(TA_GridHelpers.java:194)
	at de.vandermeer.asciithemes.TA_Grid.addGrid(TA_Grid.java:306)
	at de.vandermeer.asciitable.AT_Renderer.renderAsCollection(AT_Renderer.java:282)
	at de.vandermeer.asciitable.AsciiTable.renderAsCollection(AsciiTable.java:207)
	at de.vandermeer.skb.interfaces.render.RendersToClusterWidth.renderAsIterator(RendersToClusterWidth.java:52)
@laeubi
Copy link
Author

laeubi commented Dec 9, 2022

This seem to happen when the last value of a cell is null, it would be good that:

  1. When adding a row and the last value is null an IllegalArgumentException is thrown
    -- or --
  2. the code just handles the null like an empty String

@IvanKarpov-1
Copy link

I have one more addition to the problem. It seems that it also occurs when some cell of the last row of the table has a value of null. Even if that is not the last cell.

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

No branches or pull requests

2 participants