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

Use Java modern features/APIs #357

Merged
merged 2 commits into from
May 12, 2024
Merged

Conversation

marcospereira
Copy link
Contributor

What?

This runs OpenRewrite Java 17 migration recipe to adopt new/modern Java language features and APIs.

A few of the more extensive changes involve:

How?

I've added the plugin described in OpenRewrite docs but executed it only for projects that include jte-parent as a parent.

Copy link

codecov bot commented May 7, 2024

Codecov Report

Attention: Patch coverage is 91.30435% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 91.31%. Comparing base (9320ca7) to head (a367477).

Files Patch % Lines
...ain/java/gg/jte/models/runtime/StaticJteModel.java 0.00% 1 Missing and 1 partial ⚠️
...rc/main/java/gg/jte/compiler/TemplateCompiler.java 83.33% 0 Missing and 1 partial ⚠️
...extensionsupport/ExtensionTemplateDescription.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #357      +/-   ##
============================================
- Coverage     91.38%   91.31%   -0.08%     
+ Complexity     1219     1217       -2     
============================================
  Files            76       76              
  Lines          3168     3165       -3     
  Branches        493      490       -3     
============================================
- Hits           2895     2890       -5     
- Misses          163      164       +1     
- Partials        110      111       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@casid
Copy link
Owner

casid commented May 10, 2024

@marcospereira this looks good to me, except that I would like to revert the record commit.

It doesn't bring much benefit compared to the dumb data classes that are already there (except adding getters that are not really needed).

Especially stuff like public record DirectoryCodeResolver is really bad. This is not a data class, but public API. The change also breaks the public API for every user who is using getRoot() on that class for no reason.

@marcospereira
Copy link
Contributor Author

It doesn't bring much benefit compared to the dumb data classes that are already there (except adding getters that are not really needed).

Yeah, I was also in doubt about it, mainly because of the compatibility issue, and that is why the PR was a draft.

It is now gone. :-)

@marcospereira marcospereira marked this pull request as ready for review May 10, 2024 20:30
@casid casid merged commit 8c7703b into casid:main May 12, 2024
9 checks passed
@casid
Copy link
Owner

casid commented May 12, 2024

Awesome! Thank you for the clean-up :-)

@marcospereira marcospereira deleted the openrewrite-java17 branch May 13, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants