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

Java 11 recipe for default keystore change #667

Merged

Conversation

ranuradh
Copy link
Contributor

@ranuradh ranuradh commented Jan 27, 2025

What's changed?

recipe: org.openrewrite.java.migrate.ChangeDefaultKeyStore in Java11
image

What's your motivation?

This recipe returns jks when Keystore.getDefaultType() is called

Anyone you would like to review specifically?

@timtebeek

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@ranuradh ranuradh self-assigned this Jan 27, 2025
@ranuradh ranuradh added the recipe Recipe requested label Jan 27, 2025

@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
return new JavaVisitor<ExecutionContext>() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like we'll want to add a precondition here on (exclusively) using an older Java version before applying any changes here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @timtebeek i added a Percondition.check() to the code and updated the test as well.

@timtebeek
Copy link
Contributor

As a quick FYI: I'm out this week, but my colleagues will step in for a review.

@ranuradh
Copy link
Contributor Author

@timtebeek can you assign the review to someone else? I fixed the PR based on your comments

@timtebeek timtebeek assigned MBoegers and unassigned MBoegers Jan 28, 2025
@timtebeek timtebeek requested a review from MBoegers January 28, 2025 17:29
@MBoegers
Copy link
Contributor

Will have a look soon

@ranuradh
Copy link
Contributor Author

ranuradh commented Feb 4, 2025

Hi @MBoegers let me know if you had any feedback on this PR. Thanks!

@timtebeek timtebeek self-requested a review February 4, 2025 15:12
@MBoegers
Copy link
Contributor

MBoegers commented Feb 4, 2025

sorry, excuse the delay.. I added 2 positive tests and will merge.
Thank you so much for your contribution!

@MBoegers MBoegers merged commit 23ddb3b into openrewrite:main Feb 4, 2025
2 checks passed
@ranuradh ranuradh deleted the recipe_default_keystore_change_1 branch February 4, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Recipe requested
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants