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

Ignore method invocation arguments that are not string J.Literals #4276

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Ignore method invocation arguments that are not string J.Literals #4276

merged 1 commit into from
Jun 20, 2024

Conversation

Jenson3210
Copy link
Contributor

Fixes: #4275

What's changed?

A check before casting. If it is not a string, it is most likely not a dependency notation.

What's your motivation?

In line with: "Do not change anything if we are not sure", I propose to just give back this argument as is without touching.

Any additional context

This is actually not meant to be coded like this in gradle, yet it is working unfortunately and has been copy/pasted througout some of our repo's.

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 self-assigned this Jun 20, 2024
@timtebeek timtebeek self-requested a review June 20, 2024 20:10
@timtebeek timtebeek added the bug Something isn't working label Jun 20, 2024
Copy link
Contributor

@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.

Neat and localized fix, thanks!

@timtebeek timtebeek merged commit 83f3cde into openrewrite:main Jun 20, 2024
2 checks passed
crankydillo pushed a commit to crankydillo/rewrite that referenced this pull request Jul 11, 2024
@Jenson3210 Jenson3210 deleted the issue_4275 branch September 13, 2024 06:54
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.

ClassCastException in UpgradeDependencyVersion
2 participants