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

Add a null check so that the proper exception is thrown. #1405

Closed
wants to merge 1 commit into from

Conversation

spmallette
Copy link
Contributor

This issue is resolved in 3.x and is essentially backported from 47d106c which was part of GROOVY-8279.

This issue ends up being a problem for Apache TinkerPop which relies on groovysh fairly heavily. Without this change, a fail within shell.parse() within the try block leaves the type as null and then provides that argument to removeClassCacheEntry(). At that point no matter what exception shell.parse() threw, the Interpreter.evaluate() will end up throwing a NullPointerException thus masking the error. In our case at TinkerPop, the exception typically masked is a StackOverflowError which would be much more useful than the NullPointerException as it would point to a common specific problem that we could alert users to more readily.

This issue is resolved in 3.x and is essentially backported from 47d106c which was part of GROOVY-8279.
@paulk-asert
Copy link
Contributor

LGTM

@asfgit asfgit closed this in 9ce8545 Oct 20, 2020
@paulk-asert
Copy link
Contributor

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants