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

Parser should allow parsing of JavaSources when dependencies changed #879

Open
Tracked by #858 ...
fabapp2 opened this issue Aug 25, 2023 · 0 comments
Open
Tracked by #858 ...
Assignees
Labels
in: sbm-core in: sbm-support-rewrite Issue is related to the sbm-support-rewrite compionent revamp type: enhancement New feature or request

Comments

@fabapp2
Copy link
Contributor

fabapp2 commented Aug 25, 2023

What needs to be done

The RewriteProjectParser should be refactored to allow parsing a list of JavaSources with a given classpath.

Why it needs to be done

#858 is blocked by #871 which is blocked by this issue.

Acceptance Criteria

  • All markers are updated and updated

Additional Information

Example

Given a reactor build with four pom.xml: parent, A, B, and C where A depends on B and B depends on C.

reactor-build

When a dependency is added to B and the classpath changed

Then modules A and B must be parsed again to resolve the new types added.
While C is not required to be parsed again (it didn't change), the types provided by C must be made available when parsing B, and B's types must be made available when parsing C and so forth.

Learnings

See #971

  • The JavaParser instance keeps type information as state.
  • To reuse previously built type information (the type information of C in the example above) it must be provided when re-parsing the next higher modules in the reactor hierarchy (B).
  • Sharing the TypeCache is not enough
  • The state is kept after calling reset().
  • Keeping and reusing the JavaParser instance itself could be possible, it can be provided through a Marker, similar to JavaSourceSet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: sbm-core in: sbm-support-rewrite Issue is related to the sbm-support-rewrite compionent revamp type: enhancement New feature or request
Projects
None yet
1 participant