-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1325 - Sorted now implements SortedSet. #1329
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1329 +/- ##
============================================
- Coverage 89.58% 89.58% -0.01%
- Complexity 1659 1665 +6
============================================
Files 277 277
Lines 3967 3976 +9
Branches 211 211
============================================
+ Hits 3554 3562 +8
Misses 380 380
- Partials 33 34 +1
Continue to review full report at Codecov.
|
This pull request #1329 is assigned to @victornoel/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @paulodamaso/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be no monetary reward for this job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzurauskas some comments
*/ | ||
public final class Sorted<T> extends SetEnvelope<T> { | ||
@SuppressWarnings("PMD.OnlyOneConstructorShouldDoInitialization") | ||
public final class Sorted<T> extends SetEnvelope<T> implements SortedSet<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzurauskas can you introduce a SortedSetEnvelope
(that extends SetEnvelope
) responsible of delegating to a wrapped set and have Sorted
only responsible of handling the Iterable
-based constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victornoel Yes, good idea.
*/ | ||
public final class Sorted<T> extends SetEnvelope<T> { | ||
@SuppressWarnings("PMD.OnlyOneConstructorShouldDoInitialization") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzurauskas this can be removed if you introduce the SortedSetEnvelope
as proposer in the other comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victornoel Right.
new Assertion<>( | ||
"Must return sorted subset", | ||
new Sorted<>(Integer::compareTo, 3, 6, 1, 9, 3).subSet(3, 9), | ||
new IsIterableContainingInOrder<>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzurauskas I think you can use directly IsEqual
with a new SetOf
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victornoel It will ignore order, since normal sets are unordered. I need to make sure the order is right here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzurauskas ah yes of course!
new Assertion<>( | ||
"Must return sorted headset", | ||
new Sorted<>(Integer::compareTo, 3, 6, 1, 9, 3).headSet(9), | ||
new IsIterableContainingInOrder<>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzurauskas same here, IsEqual
with a new SetOf
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victornoel Same answer.
new Assertion<>( | ||
"Must return sorted tailset", | ||
new Sorted<>(Integer::compareTo, 3, 6, 1, 9, 3).tailSet(6), | ||
new IsIterableContainingInOrder<>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzurauskas same here, IsEqual
with a new SetOf
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victornoel Same answer.
@paulodamaso should be good to merge |
@paulodamaso ping :) |
@victornoel Sorry, busy week |
@rultor merge |
@paulodamaso OK, I'll try to merge now. You can check the progress of the merge here |
@paulodamaso Done! FYI, the full log is here (took me 11min) |
Code review was too long (9 days), architects (@paulodamaso) were penalized, see §55 |
@sereshqua/z please review this job completed by @victornoel/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed |
@0crat quality good |
PR for #1325
Sorted
now implementsSortedSet
.