Skip to content

No classpath update after source is saved #987

Closed

Description

@BoykoAlex

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.

Activity

  1. added
    for: eclipse
    for: vscode
    and removed on Mar 3, 2023
  2. added this to the 4.19.0.RELEASE milestone on Mar 3, 2023
  3. martinlippert commented on Mar 3, 2023

    @martinlippert
    Member

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

  4. BoykoAlex commented on Mar 3, 2023

    @BoykoAlex
    ContributorAuthor

    @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.

  5. martinlippert commented on Mar 3, 2023

    @martinlippert
    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).

  6. BoykoAlex commented on Mar 3, 2023

    @BoykoAlex
    ContributorAuthor

    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...

  7. BoykoAlex commented on May 18, 2023

    @BoykoAlex
    ContributorAuthor

    As a trial fix pushed this in: 8a64655

  8. BoykoAlex commented on Aug 1, 2023

    @BoykoAlex
    ContributorAuthor

    Likely fixed with 4181d56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: eclipsefor: vscodestatus: needs-investigationtheme: internal-architecturetype: bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions