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

(#1212) Fixed SetOf, which discarded all elements after duplicated occurrence #1215

Merged
merged 4 commits into from
Nov 18, 2019

Conversation

fanifieiev
Copy link
Contributor

This pull request is for issue 1212

org.cactoos.set.SetOf was causing an issue when the original collection/array contained duplicate values, which resulted the cut off of the collection just right after first duplicated value.

@0crat 0crat added the scope label Nov 1, 2019
@0crat
Copy link
Collaborator

0crat commented Nov 1, 2019

Job #1215 is now in scope, role is REV

@codecov-io
Copy link

codecov-io commented Nov 1, 2019

Codecov Report

Merging #1215 into master will increase coverage by 0.14%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1215      +/-   ##
============================================
+ Coverage     89.22%   89.37%   +0.14%     
- Complexity     1660     1671      +11     
============================================
  Files           279      280       +1     
  Lines          3992     4008      +16     
  Branches        213      213              
============================================
+ Hits           3562     3582      +20     
+ Misses          396      392       -4     
  Partials         34       34
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/cactoos/set/SetOf.java 100% <100%> (ø) 3 <0> (ø) ⬇️
src/main/java/org/cactoos/scalar/Solid.java 90% <0%> (-10%) 3% <0%> (-1%)
src/main/java/org/cactoos/io/ReaderOf.java 96.55% <0%> (-3.45%) 28% <0%> (-1%)
src/main/java/org/cactoos/list/Immutable.java 100% <0%> (ø) 27% <0%> (ø) ⬇️
...n/java/org/cactoos/list/ImmutableListIterator.java 91.66% <0%> (ø) 9% <0%> (?)
src/main/java/org/cactoos/list/ListIteratorOf.java 95.23% <0%> (+0.79%) 12% <0%> (ø) ⬇️
...ain/java/org/cactoos/list/ListIteratorNoNulls.java 85.71% <0%> (+38.09%) 9% <0%> (+4%) ⬆️

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 5e0da30...7f5640a. Read the comment docs.

@0crat
Copy link
Collaborator

0crat commented Nov 1, 2019

This pull request #1215 is assigned to @fabriciofx/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

@@ -60,7 +61,7 @@ public SetOf(final T... array) {
public SetOf(final Iterable<T> src) {
super(() -> {
final Set<T> tmp = new HashSet<>();
new And(tmp::add, src)
new And((Proc<T>) tmp::add, src)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@fanifieiev I think it would be way better to use src.forEach(tmp::add), that's what Iterable is made for.

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 Sure, that one looks better. But just wondering what was the And(final Proc<X> proc, final Iterable<X> src) created for ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@fanifieiev I think it is here only for completeness. And is more about the logical assertion (which does not rely on side effect as the Proc version does).

I created #1226 in reaction to this discussion :)

@fanifieiev
Copy link
Contributor Author

@0crat status

@0crat
Copy link
Collaborator

0crat commented Nov 6, 2019

@0crat status (here)

@fanifieiev This is what I know about this job in C63314D6Z, as in §32:

@fanifieiev
Copy link
Contributor Author

@0crat wait for REV

@0crat
Copy link
Collaborator

0crat commented Nov 7, 2019

@0crat wait for REV (here)

@fanifieiev @fanifieiev/z you can't register impediment for this job

@fanifieiev
Copy link
Contributor Author

@0crat status

@0crat
Copy link
Collaborator

0crat commented Nov 11, 2019

@0crat status (here)

@fanifieiev This is what I know about this job in C63314D6Z, as in §32:

@fanifieiev
Copy link
Contributor Author

@paulodamaso This PR review is taking really long.

Copy link
Contributor

@fabriciofx fabriciofx left a comment

Choose a reason for hiding this comment

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

@fanifieiev please, take a look.

"Can't behave as a set",
public void behaveAsSetWithOriginalDuplicationsInTheTail() {
new Assertion<>(
"Must keep unique numbers",
Copy link
Contributor

Choose a reason for hiding this comment

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

@fanifieiev please, change "Must keep unique numbers" to "Must keep unique integer numbers".

@Test
public void behaveAsSetWithOriginalDuplicationsInTheHead() {
new Assertion<>(
"Must keep unique numbers",
Copy link
Contributor

Choose a reason for hiding this comment

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

@fanifieiev please, change "Must keep unique numbers" to "Must keep unique integer numbers".

@Test
public void behaveAsSetWithOriginalDuplicationsInTheMiddle() {
new Assertion<>(
"Must keep unique numbers",
Copy link
Contributor

Choose a reason for hiding this comment

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

@fanifieiev please, change "Must keep unique numbers" to "Must keep unique integer numbers".

}

@Test
public void behaveAsSetWithOriginalMergedCollectionsWithDuplicates() {
Copy link
Contributor

Choose a reason for hiding this comment

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

@fanifieiev please, add more tests for:

  • chars
  • double numbers
  • other type object different of primitives/boxed and string.

@fanifieiev
Copy link
Contributor Author

@fabriciofx The review issues have been resolved. Please review.

@fabriciofx
Copy link
Contributor

@fanifieiev seems fine to me. @paulodamaso can you merge it, please?

@fanifieiev
Copy link
Contributor Author

@paulodamaso Can you please merge it? Please see

@fabriciofx
Copy link
Contributor

@paulodamaso ping

@paulodamaso
Copy link
Contributor

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Nov 18, 2019

@rultor merge

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

@rultor rultor merged commit 7f5640a into yegor256:master Nov 18, 2019
@rultor
Copy link
Collaborator

rultor commented Nov 18, 2019

@rultor merge

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

@0crat
Copy link
Collaborator

0crat commented Nov 18, 2019

@sereshqua/z please review this job completed by @fabriciofx/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@0crat
Copy link
Collaborator

0crat commented Nov 18, 2019

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

@0crat
Copy link
Collaborator

0crat commented Nov 18, 2019

The job #1215 is now out of scope

@0crat 0crat removed the scope label Nov 18, 2019
@0crat
Copy link
Collaborator

0crat commented Nov 18, 2019

Payment to ARC for a closed pull request, as in §28: +10 point(s) just awarded to @paulodamaso/z

@sereshqua
Copy link

@fabriciofx please make sure next CR your comments would be mostly about design problems, not just the cosmetic issues

@fabriciofx
Copy link
Contributor

@sereshqua ok. Thanks!

@sereshqua
Copy link

@0crat quality acceptable

@0crat
Copy link
Collaborator

0crat commented Nov 19, 2019

Quality review completed: +4 point(s) just awarded to @sereshqua/z

@0crat
Copy link
Collaborator

0crat commented Nov 19, 2019

Order was finished, quality is "acceptable": +15 point(s) just awarded to @fabriciofx/z

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.

8 participants