Skip to content

Replace if instanceof chains with modern switch pattern matching and add unit test#6977

Merged
hansva merged 2 commits intoapache:mainfrom
leehaut:hotfix/lance-common-54
Apr 9, 2026
Merged

Replace if instanceof chains with modern switch pattern matching and add unit test#6977
hansva merged 2 commits intoapache:mainfrom
leehaut:hotfix/lance-common-54

Conversation

@leehaut
Copy link
Copy Markdown
Contributor

@leehaut leehaut commented Apr 9, 2026

Improvements:

  • Replaced multiple if/else + instanceof conditional branches with a switch expression using pattern matching.
  • Reduced nested conditional complexity and improved maintainability.
  • Added unit tests to cover all switch branches.

leehaut added 2 commits April 9, 2026 14:43
…add unit test

Signed-off-by: lance <leehaut@gmail.com>
…add unit test

Signed-off-by: lance <leehaut@gmail.com>
@hansva hansva merged commit ce77dbf into apache:main Apr 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants