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

StringLiteral.getLiteralValue is not thread-safe #3424

Open
martinlippert opened this issue Dec 9, 2024 · 4 comments
Open

StringLiteral.getLiteralValue is not thread-safe #3424

martinlippert opened this issue Dec 9, 2024 · 4 comments
Labels
needinfo Further information is requested

Comments

@martinlippert
Copy link

It looks like StringLiteral.getLiteralValue is throwing IllegalStateExceptions in some cases when used from multiple threads, most likely due to the internal scanner object being used in a stateful way.

@jukzi
Copy link
Contributor

jukzi commented Dec 9, 2024

Please paste the Exception Stacktrace and why it is used in multiple threads

@martinlippert
Copy link
Author

Example stack traces can be found here: spring-projects/sts4#1434 - but this comes from the Spring Tools using JDT Core to parse and analyze source code, so the stack traces have no origins in JDT or Eclipse itself.

We use the AST over there to implement content-assist, do additional validations, and extract index information from a Spring perspective.

@jukzi
Copy link
Contributor

jukzi commented Dec 9, 2024

That reference only shows a IllegalArgumentException, not a IllegalStateException , also the line number does not match master.
The IllegalArgumentException complains tokenType!=TerminalTokens.TokenNameStringLiteral

I don't see a connection to concurrent use. You should be able to set a breakpoint to find the sourcecode in question that cannot be parsed.

@martinlippert
Copy link
Author

That reference only shows a IllegalArgumentException, not a IllegalStateException , also the line number does not match master. The IllegalArgumentException complains tokenType!=TerminalTokens.TokenNameStringLiteral

You are right, my bad, it is an IllegalArgumentException, not an IllegalStateException. The line numbers are from using JDT Core 3.39.

I don't see a connection to concurrent use. You should be able to set a breakpoint to find the sourcecode in question that cannot be parsed.

I am not yet convinced about this not being related to concurrent use, but let me try to dig deeper here. Always hard to reproduce those things, but let me see what I can find out with our hints here. Thanks so much for looking into this so quickly and for providing the feedback here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants