Skip to content

Conversation

@mjsax
Copy link
Member

@mjsax mjsax commented Dec 16, 2025

  • Avoid double-brace initialization
  • Fix timeout error handling, by pass in correct list of topic names
  • Remove unnecessary code

Reviewers: Vincent Potuček (@Pankraz76), Lucas Brutschy
[email protected]

@github-actions github-actions bot added streams small Small PRs labels Dec 16, 2025
topicsStillToValidate.addAll(topicConfigsStillToValidate);

maybeThrowTimeout(new TimeoutContext(
new HashSet<String>() {{

Choose a reason for hiding this comment

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

interesting syntax. Its like an array init, within the declaration, right?

Does is make an performance difference, or is it just error prone, thus some kind of community convent to avoid?

Copy link
Member Author

Choose a reason for hiding this comment

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

Its like an array init, within the declaration, right?

Yes. Similar.

Does is make an performance difference, or is it just error prone, thus some kind of community convent to avoid?

It's not considered best practice. Overlooked during code-review. From Copilot:

Using double-brace initialization creates an anonymous inner class and can lead to memory leaks. Consider using a standard HashSet construction with addAll() calls or collect the items into a set using streams.

@mjsax mjsax changed the title MINOR: avoid double-brace initilization MINOR: code cleanup in InternalTopicManager Dec 17, 2025
@Pankraz76
Copy link

Pankraz76 commented Dec 17, 2025

thanks for the hint, its even an error lvl warning.

This should be done the right way to ensure its done overall and not just somewhere. Human interaction can not scale this issue accordingly.

Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
@mjsax
Copy link
Member Author

mjsax commented Dec 17, 2025

I agree that it would be great to fail the build for this. Would you be interested to look into it, and do a PR changing the gradle setup, and fix any potentially lingering code that uses double-brace initialization?

@Pankraz76
Copy link

already on it, thank you for initiative.

Copy link
Member

@lucasbru lucasbru 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

Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
…afka.openrewrite.SanityCheck` apache#21165

Signed-off-by: Vincent Potucek <[email protected]>
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
…afka.openrewrite.SanityCheck` apache#21165

Signed-off-by: Vincent Potucek <[email protected]>
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
…afka.openrewrite.SanityCheck` apache#21165

Signed-off-by: Vincent Potucek <[email protected]>
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
…afka.openrewrite.SanityCheck` apache#21165

Signed-off-by: Vincent Potucek <[email protected]>
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
…afka.openrewrite.SanityCheck` apache#21165

Signed-off-by: Vincent Potucek <[email protected]>
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 17, 2025
…apache.kafka.openrewrite.SanityCheck` apache#21165

Signed-off-by: Vincent Potucek <[email protected]>
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Pankraz76 pushed a commit to Pankraz76/kafka that referenced this pull request Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants