Skip to content

Conversation

Jenson3210
Copy link
Contributor

@Jenson3210 Jenson3210 commented Jun 23, 2025

What's changed?

If any of the branches returns a value, we do (for now) not convert it to a switch as it is invalid.
Besides this change: If any of the values throws, we do allow this.
We used to unwrap if-statements if they were the only one -> no longer happening as only expressions and Throws are allowed to be written in that syntax.

I know we can enhance to do return from switch but I first want to stabilize the existing recipe before working on:

What's your motivation?

Clean up compilation issues occuring during run of the recipe.

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

@Jenson3210 Jenson3210 requested a review from timtebeek June 23, 2025 11:03
@Jenson3210 Jenson3210 self-assigned this Jun 23, 2025
@Jenson3210 Jenson3210 added the bug Something isn't working label Jun 23, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jun 23, 2025
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/test/java/org/openrewrite/java/migrate/util/MigrateCollectionsSingletonMapTest.java
    • lines 108-108

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/test/java/org/openrewrite/java/migrate/util/MigrateCollectionsSingletonMapTest.java
    • lines 108-108

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/test/java/org/openrewrite/java/migrate/util/MigrateCollectionsSingletonMapTest.java
    • lines 108-108

Copy link
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Thanks for the isolated fixes here! Makes reviewing a lot easier.

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Jun 23, 2025
@timtebeek timtebeek merged commit d14df02 into main Jun 23, 2025
2 checks passed
@timtebeek timtebeek deleted the fix-compilation-issues branch June 23, 2025 16:36
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Jun 23, 2025
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.

2 participants