Skip to content
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

Merged
merged 2 commits into from
Mar 29, 2020
Merged

Conversation

vzurauskas
Copy link
Contributor

PR for #1325

Sorted now implements SortedSet.

@codecov-io
Copy link

Codecov Report

Merging #1329 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/cactoos/set/Sorted.java 100.00% <100.00%> (ø) 10.00 <8.00> (+7.00)
src/main/java/org/cactoos/scalar/Solid.java 90.00% <0.00%> (-10.00%) 3.00% <0.00%> (-1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41a409c...37f2408. Read the comment docs.

@0crat
Copy link
Collaborator

0crat commented Mar 20, 2020

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

Copy link
Collaborator

@victornoel victornoel left a 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> {
Copy link
Collaborator

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.

Copy link
Contributor Author

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")
Copy link
Collaborator

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

Copy link
Contributor Author

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<>(
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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<>(
Copy link
Collaborator

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.

Copy link
Contributor Author

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<>(
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel Same answer.

@victornoel
Copy link
Collaborator

@paulodamaso should be good to merge

@victornoel
Copy link
Collaborator

@paulodamaso ping :)

@paulodamaso
Copy link
Contributor

@victornoel Sorry, busy week

@paulodamaso
Copy link
Contributor

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Mar 29, 2020

@rultor merge

@paulodamaso OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 02038f9 into yegor256:master Mar 29, 2020
@rultor
Copy link
Collaborator

rultor commented Mar 29, 2020

@rultor merge

@paulodamaso Done! FYI, the full log is here (took me 11min)

@0crat
Copy link
Collaborator

0crat commented Mar 29, 2020

Code review was too long (9 days), architects (@paulodamaso) were penalized, see §55

@0crat
Copy link
Collaborator

0crat commented Mar 29, 2020

@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 0crat removed the scope label Mar 29, 2020
@sereshqua
Copy link

@0crat quality good

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.

7 participants