Skip to content

Parser should allow parsing of JavaSources when dependencies changed #879

Open
@fabapp2

Description

@fabapp2

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions