Skip to content

Stable ordering for legacy hint items in popup - #9676

Open
mbien wants to merge 1 commit into
apache:masterfrom
mbien:stable-hint-item-ordering
Open

mbien wants to merge 1 commit into
apache:masterfrom
mbien:stable-hint-item-ordering

Conversation

@mbien

@mbien mbien commented Oct 7, 2026

Copy link
Copy Markdown
Member

Legacy Fix impls which were not EnhancedFixes yet were sorted with the same key. This made their list position unstable. Their text is now appended to the key which should produce better results.

bonus:

While testing I noticed that some fixes didn't get deduplicated due to the fact that they didn't implement proper equals/hashCode. Those are now records.

fixes #9658

Legacy Fix impls which were not EnhancedFixes yet were sorted with
the same key. This made made their list position unstable. Their text
is now appended to the key which should produce better results.

bonus:

While testing I noticed that some fixes didn't get deduplicated
due to the fact that they didn't implement proper equals/hashCode.
Those are now records.
@mbien mbien added this to the NB32 milestone Oct 7, 2026
@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) hints ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Oct 7, 2026
@mbien
mbien requested a review from lahodaj October 7, 2026 02:57
@neilcsmith-net

neilcsmith-net commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Looks good. Thanks! I took a brief look through the issue yesterday, but was assuming use of unordered Set somewhere rather than this.

Can we keep record changes etc. to separate commits in future (same PR fine). It makes seeing the actual changes harder.

@mbien

mbien commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

the record changes are also fixing an issue since those objects didn't have proper equals/hashcode

@mbien

mbien commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

tbh it would have been more elegant to move getSortText() as default method up to Fix but this would leave EnhancedFix empty - which is a little weird. But this can be still done in future cleanups.

@neilcsmith-net

Copy link
Copy Markdown
Member

the record changes are also fixing an issue since those objects didn't have proper equals/hashcode

Sorry, completely missed that - I'll try reading everything you've written next time! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) hints Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some light bulb drop down suggestions come in a random, different order between hits of Alt-Enter

2 participants