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

No classpath update after source is saved #987

Closed
BoykoAlex opened this issue Mar 3, 2023 · 6 comments
Closed

No classpath update after source is saved #987

BoykoAlex opened this issue Mar 3, 2023 · 6 comments
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode status: needs-investigation theme: internal-architecture type: bug

Comments

@BoykoAlex
Copy link
Contributor

Java file with class A is definition of an annotation that is annotated with @Configuration
Java file with class B annotated with A has bean definitions.

Once @Configuration is removed from A and saved it is expected that B has a warning about missing @Configuration. However, nothing happens. Even after editing B.

The issue is that classpath is considered not to be changed. Therefore java parser isn't reset and still based on old implementation of everything. If project is closed and re-opened (or IDE restarted or reloaded) then B class would have proper warning.

This issue has been around for a long time.

@martinlippert
Copy link
Member

We are talking about the OpenRewrite based reconciling here, correct?

@BoykoAlex
Copy link
Contributor Author

@martinlippert yes, but I suspect that JDT Java reconciling would be suffering the same issue. Don't think we have examples of JDT reconciling of the same caliber... It is only SpEL expressions validation that looks at Spring Property Index.

@martinlippert
Copy link
Member

@BoykoAlex Sounds to me like (in the longer run) we would have to keep record of cross-references (when reconciling, when scanning for symbols, etc.), so that we can identify the elements that we need to re-scan if something changes beyond the changed file itself.

Let's think about this for the 4.19.0 release cycle (at least on the spike level).

@BoykoAlex
Copy link
Contributor Author

Our java parsers gather classpath as JARs and output folders. Parsing each source uses as classpath JARs + output folder content (.class files) rather than sources (.java files)... Therefore, i think we may need a new event for output folder change or perhaps include output folder change in the classpath changed event...

4.19 sounds good. Would need a bit brain storming on how to accomplish this without degrading performance much...

@BoykoAlex
Copy link
Contributor Author

As a trial fix pushed this in: 8a64655

@BoykoAlex
Copy link
Contributor Author

Likely fixed with 4181d56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode status: needs-investigation theme: internal-architecture type: bug
Projects
None yet
Development

No branches or pull requests

2 participants