Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Conversation

@Laurens-W
Copy link
Contributor

What's changed?

Apply newest getCaseLabel instead of getExpression

Anyone you would like to review specifically?

@timtebeek

Have you considered any alternatives or workarounds?

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

@Laurens-W Laurens-W added the bug Something isn't working label Feb 12, 2025
@Laurens-W Laurens-W requested a review from timtebeek February 12, 2025 13:51
@Laurens-W Laurens-W self-assigned this Feb 12, 2025

s = s.withCases(s.getCases().withStatements(ListUtils.flatMap(s.getCases().getStatements(), it -> {
if (it instanceof J.Case && changeCondition(((J.Case) it).getExpressions())) {
if (it instanceof J.Case && changeCondition(((J.Case) it).getCaseLabels())) {
Copy link
Member

Choose a reason for hiding this comment

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

Same concern as on the Python counter part: I'm not sure these replacement fields are populated here already.

Copy link
Contributor Author

@Laurens-W Laurens-W Feb 19, 2025

Choose a reason for hiding this comment

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

Oleg changed the javascript remoting parser to use the CaseLabels back when it was introduced

@timtebeek timtebeek merged commit 2e4418d into main Feb 19, 2025
1 check passed
@timtebeek timtebeek deleted the fix-potential-java21-switch-issue branch February 19, 2025 15:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants