Skip to content

Simplify SortedProperties.entrySet() - #2629

Merged
holgerfriedrich merged 1 commit into
apache:mainfrom
rovarga:sortedprops
Aug 22, 2026
Merged

Simplify SortedProperties.entrySet()#2629
holgerfriedrich merged 1 commit into
apache:mainfrom
rovarga:sortedprops

Conversation

@rovarga

@rovarga rovarga commented May 2, 2026

Copy link
Copy Markdown
Contributor

Use Comparator.comparing() and Collectors.toCollection() to make the
method much more obvious.

Signed-off-by: Robert Varga robert.varga@pantheon.tech

Use Comparator.comparing() and Collectors.toCollection() to make the
method much more obvious.

Signed-off-by: Robert Varga <robert.varga@pantheon.tech>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies SortedProperties.entrySet() to make the sorting logic clearer by using Comparator.comparing(...) and collecting directly into a LinkedHashSet, keeping the returned iteration order sorted by key string.

Changes:

  • Replaced the custom comparator + iterator loop with a stream pipeline using Comparator.comparing(...).
  • Collected the sorted entries via Collectors.toCollection(LinkedHashSet::new).
  • Removed the now-unused Iterator import and added Collectors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@holgerfriedrich holgerfriedrich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@holgerfriedrich

Copy link
Copy Markdown
Contributor

(closed and reopened to trigger CI)

@holgerfriedrich
holgerfriedrich merged commit fd9bd47 into apache:main Aug 22, 2026
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants