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

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

2 participants