Skip to content

Prevent duplication of guard clause in switch expressions#8971

Merged
mbien merged 1 commit intoapache:masterfrom
homberghp:issue8495
Nov 9, 2025
Merged

Prevent duplication of guard clause in switch expressions#8971
mbien merged 1 commit intoapache:masterfrom
homberghp:issue8495

Conversation

@homberghp
Copy link
Contributor

@homberghp homberghp commented Oct 30, 2025

closes #8495

This PR cleans up compare to the previous PR.

Implemented are the changes in CasualDiff and added test in SwitchTest as suggested by lahodaj


^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PR correctly labeled, did the right tests run? When did they run?
  2. Is this PR squashed?
  3. Are author name / email address correct? Are co-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch: don't merge. (full wiki article)

@homberghp homberghp changed the title Issue8495 Issue8495 prevent duplication of guard clause in switch expressions Oct 30, 2025
Copy link
Contributor

@lahodaj lahodaj left a comment

Choose a reason for hiding this comment

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

Makes sense to me (although the commit should probably be squashed&there should be a commit message along the lines of:

[8495] prevent duplication of guard clause in switch expressions

@mbien
Copy link
Member

mbien commented Nov 6, 2025

this PR here would also need a proper commit message before integration. If I am allowed to push into the PR i could fix it to safe time. Setting NB 29 milestone to keep this PR on the radar.

@mbien mbien added this to the NB29 milestone Nov 6, 2025
@mbien mbien changed the title Issue8495 prevent duplication of guard clause in switch expressions Prevent duplication of guard clause in switch expressions Nov 6, 2025
@mbien mbien added the Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) label Nov 6, 2025
@mbien mbien added the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Nov 9, 2025
@mbien
Copy link
Member

mbien commented Nov 9, 2025

going to rebase, update the commit msg and then merge once CI is green again

@mbien mbien removed the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Nov 9, 2025
@mbien mbien merged commit c44fe14 into apache:master Nov 9, 2025
35 checks passed
@homberghp homberghp deleted the issue8495 branch December 2, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactoring class/record name duplicates switch "when" cases if the class/record is instantiated in those cases

3 participants