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

IndexOutOfBoundException for empty commands: metadata, record, run, script #90

Closed
snuyanzin opened this issue Aug 7, 2018 · 1 comment

Comments

@snuyanzin
Copy link
Collaborator

Any of

!metadata
!record
!run
!script

will fail with something similar to

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.LinkedList.checkElementIndex(LinkedList.java:555)
	at java.util.LinkedList.remove(LinkedList.java:525)
	at sqlline.Commands.metadata(Commands.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
	at sqlline.SqlLine.dispatch(SqlLine.java:791)
	at sqlline.SqlLine.begin(SqlLine.java:668)
	at sqlline.SqlLine.start(SqlLine.java:373)
	at sqlline.SqlLine.main(SqlLine.java:265)

At least it makes sense to have more relevant exception message

@julianhyde
Copy link
Owner

Fixed in 4bb2ed1, PR #91. Thanks @snuyanzin!

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 a pull request may close this issue.

2 participants