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

Avoid calling parsers when there are no source files #660

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

Bananeweizen
Copy link
Contributor

With empty lists of main or test, Java or Kotlin files avoid invoking the parsers completely. That's more performant and avoids any bad side effects during initialization of the parsers.

Fixes #658.

Anything in particular you'd like reviewers to focus on?

You may want to reformat, I used the Eclipse formatter.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've added the license header to any new files through ./gradlew licenseFormat
  • I've used the IntelliJ IDEA auto-formatter on affected files

With empty lists of main or test, Java or Kotlin files avoid invoking
the parsers completely. That's more performant and avoids any bad side
effects during initialization of the parsers.

Fixes openrewrite#658.
@timtebeek timtebeek added the bug Something isn't working label Nov 22, 2023
@timtebeek timtebeek merged commit 379c671 into openrewrite:main Nov 22, 2023
1 check passed
@timtebeek
Copy link
Contributor

Thanks a lot! Yes makes sense not to initialize parsers that might go unused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Kotlin parser failures on project without Kotlin sources
2 participants