Skip to content

Conversation

ori0o0p
Copy link
Contributor

@ori0o0p ori0o0p commented Nov 25, 2024

What changes are being made and why?

The usage of instanceof has been standardized across the codebase.
This PR replaces traditional instanceof checks with pattern matching.
It improves code readability, removes redundant casts, and ensures consistent coding style.


How the changes have been QAed?

The changes have been QAed by running all existing unit tests to ensure no regressions.
Example scenario:

Object input = "example";
if (input instanceof String str) {
    System.out.println("Length: " + str.length());
}

This scenario was verified in cases where instanceof with pattern matching is used to ensure compatibility.


Setup Instructions

No special setup is required.

closes #6064

@ori0o0p ori0o0p force-pushed the refactor-consistent-instanceof-patterns branch from 108e1d7 to 422463a Compare November 25, 2024 08:06
@ori0o0p
Copy link
Contributor Author

ori0o0p commented Nov 25, 2024

I cleaned up the code by removing the redundant parentheses.

Diff

Copy link
Member

@loicmathieu loicmathieu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@ori0o0p ori0o0p force-pushed the refactor-consistent-instanceof-patterns branch from 422463a to 3bda222 Compare November 25, 2024 13:09
@ori0o0p

This comment was marked as spam.

@ori0o0p ori0o0p force-pushed the refactor-consistent-instanceof-patterns branch from 3bda222 to 4338dd7 Compare November 25, 2024 13:12
@ori0o0p
Copy link
Contributor Author

ori0o0p commented Nov 25, 2024

I've got it fixed.

@ori0o0p ori0o0p force-pushed the refactor-consistent-instanceof-patterns branch from 4338dd7 to 6a55e90 Compare November 25, 2024 13:53
@loicmathieu loicmathieu merged commit b019909 into kestra-io:develop Nov 25, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Inconsistent usage of instanceof patterns
2 participants