Repository navigation
docs: say what getQueue() and getSorter() return for a priority queue configuration - #6
Merged
Merged
Conversation
… configuration getQueue() returns null for a configuration with a priority queue, and getSorter() returns a pass-through sorter, since the priority queue sorts by itself.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The pass-through sorter can return an unsorted or differently ordered queue, violating the contract to use the supplied comparator.
1 open issue
What changed in this PR
Clarifies the sorting service’s configuration API documentation for priority queues, without changing runtime behavior.
Changes:
- Documents that
getQueue()returnsnullfor priority-queue configurations. - Describes
getSorter()as returning a pass-through sorter because the priority queue handles ordering.
| File | Description |
|---|---|
src/main/java/sortingservice/SorterConfiguration.java |
Updates Javadoc for priority-queue return behavior. |
Review effort: Balanced
Comment on lines
+49
to
+50
| * A configuration that uses a priority queue returns a sorter that | ||
| * returns the queue as is, since the priority queue sorts by itself. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The radix sorter assignment is postponed. This PR takes the javadoc fix from
feature/radix-sorterwithout the key sorter parts:getQueue()returns null for a configuration with a priority queue.getSorter()returns a pass-through sorter for a priority queue configuration, since the priority queue sorts by itself.Docs only, so no version bump is needed.
mvn clean verifypasses and javadoc gives no warnings. The KeySorter /SortKind.RADIXwork stays onfeature/radix-sorterfor later.