Skip to content
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

Use instanceof pattern to avoid explicit cast #18373

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

ijuma
Copy link
Member

@ijuma ijuma commented Jan 1, 2025

This feature was introduced in Java 16.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@github-actions github-actions bot added core Kafka Broker tools connect performance kraft mirror-maker-2 storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature KIP-932 Queues for Kafka labels Jan 1, 2025
@ijuma ijuma requested a review from mumrah January 1, 2025 18:31
Copy link
Collaborator

@apoorvmittal10 apoorvmittal10 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@mumrah mumrah left a comment

Choose a reason for hiding this comment

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

Thanks @ijuma. Looking forward to all the modern Java conveniences :)

Out of curiosity, I tried making a similar change in the clients module. IntelliJ correctly warns me that the language level is set to 11. Gradle gives a similar error.

LGTM

@ijuma
Copy link
Member Author

ijuma commented Jan 2, 2025

@mumrah Yes, I used IntelliJ's analysis to make the changes and it's smart enough to only suggest them if the Java version for the relevant module can handle them.

@ijuma ijuma merged commit d6f24d3 into apache:trunk Jan 2, 2025
9 checks passed
ijuma added a commit that referenced this pull request Jan 2, 2025
This feature was introduced in Java 16.

Reviewers: David Arthur <[email protected]>, Apoorv Mittal <[email protected]>
@ijuma ijuma deleted the instance-of-pattern-avoid-cast branch January 2, 2025 17:32
airlock-confluentinc bot pushed a commit to confluentinc/kafka that referenced this pull request Jan 3, 2025
This feature was introduced in Java 16.

Reviewers: David Arthur <[email protected]>, Apoorv Mittal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connect core Kafka Broker KIP-932 Queues for Kafka kraft mirror-maker-2 performance storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants