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

[3/3] Implement joda to java time migration recipe #591

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

amishra-u
Copy link
Contributor

What's changed?

This pr is the last part of implementing the migration from Joda-Time to the Java Time API. It creates a ScanningRecipe that first analyzes source files to identify variables that are unsafe to migrate. The unsafe variables are passed as accumulator to Visitor which modifies the expression

Key Changes:

  • Created an ScanningRecipe that utilizes JodaTimeScanner and JodaTimeVisitor
  • Removed the scanMode flag, instead used unsafe variables set for decide the identifier migration.
  • Created ScopeAwareVisitor to track the scoped variables shared by both scanner and visitor.

Not Implemented Yet:

  • Support for class variables, method parameters, and other non-local variables.

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

amishra-u and others added 2 commits October 24, 2024 19:40
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • src/main/java/org/openrewrite/java/migrate/joda/JodaTimeVisitor.java
    • lines 125-126

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • src/main/java/org/openrewrite/java/migrate/joda/JodaTimeVisitor.java
    • lines 125-126

@sambsnyd sambsnyd merged commit ec8663c into openrewrite:main Oct 25, 2024
2 checks passed
@timtebeek timtebeek added the recipe Recipe requested label Oct 25, 2024
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.

3 participants