-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[java] Add permitted subtypes to symbol API #5352
[java] Add permitted subtypes to symbol API #5352
Conversation
Generated by 🚫 Danger |
/** | ||
* In order to test simultaneously types defined in the same compilation unit, | ||
* we must store them somewhere. The fixture stores the parsed AST and allows | ||
* convenient access to the parsed types. This makes sure that we don't parse | ||
* the file once per lookup. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this only works if you keep the Fixture
instance around… which is never the case for SymImplementation.getSymbol
/ SymImplementation.getDeclaration
…
maybe we shouldn't bother with this at this stage, and eventually consider having JavaParsingHelper.DEFAULT.parseClass
implement an LRU-cache directly instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but the tests that use those methods test a single type anyway, so it doesn't matter for them. It's useful in the new tests I added though, because several types are defined in the same source file, and we want to test the connections between those symbols.
To clarify, it's there for correctness, not as an optimization. So I think we shouldn't make the caching implicit in javaparsinghelper
Describe the PR
Follow up on #5246. Add permitted subclasses to the symbol API and ensure that the AST and ASM implementations match.
Related issues
Ready?
./mvnw clean verify
passes (checked automatically by github actions)