Skip to content

Refactor Tests to instanceof pattern variable #2971

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

Closed
wants to merge 3 commits into from

Conversation

arefbehboudi
Copy link
Contributor

In some of our test cases, we are currently using the traditional instanceof checks followed by explicit type casting. With the introduction of Pattern Matching in recent Java versions, we can refactor these checks to make the code more concise and readable.

issues

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 19, 2024
@mp911de mp911de self-assigned this Aug 19, 2024
@mp911de mp911de added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 19, 2024
@mp911de mp911de linked an issue Aug 19, 2024 that may be closed by this pull request
@mp911de mp911de changed the title Refactor Tests to Use Pattern Matching Instead of instanceof Checks Refactor Tests to instanceof pattern variable Aug 20, 2024
@mp911de mp911de added this to the 3.2.10 (2023.1.10) milestone Aug 20, 2024
mp911de pushed a commit that referenced this pull request Aug 20, 2024
mp911de added a commit that referenced this pull request Aug 20, 2024
Replace instanceof check with pattern variable in production code.
Add missing Deprecated annotations.

See #2967
Original pull request: #2971
mp911de pushed a commit that referenced this pull request Aug 20, 2024
mp911de added a commit that referenced this pull request Aug 20, 2024
Replace instanceof check with pattern variable in production code.
Add missing Deprecated annotations.

See #2967
Original pull request: #2971
mp911de pushed a commit that referenced this pull request Aug 20, 2024
mp911de added a commit that referenced this pull request Aug 20, 2024
Replace instanceof check with pattern variable in production code.
Add missing Deprecated annotations.

See #2967
Original pull request: #2971
@mp911de
Copy link
Member

mp911de commented Aug 20, 2024

Thank you for your contribution. That's merged, polished, and backported now.

@mp911de mp911de closed this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Tests to instanceof pattern variable
3 participants