Skip to content

Conversation

@MBoegers
Copy link
Contributor

@MBoegers MBoegers commented Sep 12, 2024

What's changed?

String[] dictionary = {"aa", "b", "aba", "ba"}; will no longer be transformed to var dictionary = {"aa", "b", "aba", "ba"};

What's your motivation?

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

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Move type attribution like: int[] x = {1, 2} to var x = new int[]{1, 2} but that's way more complicated and adds nothing special.

Any additional context

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

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 quick fix! Hope you're able to get some sleep. :)

@timtebeek timtebeek merged commit 28099cc into openrewrite:main Sep 12, 2024
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.

UseVarForObject creates broken code when replacing array that is created with array literals

2 participants