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

#460 Bring back implementation of Folded #477

Merged
merged 16 commits into from
Jan 29, 2018
Merged

Conversation

bedward70
Copy link
Contributor

@bedward70 bedward70 commented Nov 28, 2017

After the discussion "#460 Max and Min were renamed to HighestOf and LowestOf to support Comparable implementations #475".

Step 1: Bring back implementation of Folded

  • The Folded class was deleted in the 25dc45d Yegor Bugayenko yegor256@gmail.com on 11/27/17 at 4:05 AM.
  • I brought the Folded class back.
  • I wrote the test case for Folded. Details: the FoldedTest class.

@0crat
Copy link
Collaborator

0crat commented Nov 28, 2017

@yegor256 please, pay attention to this pull request

@codecov-io
Copy link

codecov-io commented Nov 28, 2017

Codecov Report

Merging #477 into master will increase coverage by 0.12%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #477      +/-   ##
============================================
+ Coverage     67.36%   67.48%   +0.12%     
- Complexity      992      996       +4     
============================================
  Files           207      208       +1     
  Lines          3429     3442      +13     
  Branches        254      256       +2     
============================================
+ Hits           2310     2323      +13     
  Misses         1048     1048              
  Partials         71       71
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/cactoos/scalar/Folded.java 100% <100%> (ø) 4 <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 efa6fac...3dd28a3. Read the comment docs.

@0crat
Copy link
Collaborator

0crat commented Nov 28, 2017

Job gh:yegor256/cactoos#477 is in scope.

@0crat
Copy link
Collaborator

0crat commented Nov 28, 2017

Job gh:yegor256/cactoos#477 assigned to @kkamkou, please go ahead (policy).

@0crat
Copy link
Collaborator

0crat commented Dec 3, 2017

@kkamkou this job was assigned to you 5 days ago. It will be taken away from you soon, unless you close it, see par.8.

@yegor256
Copy link
Owner

yegor256 commented Dec 4, 2017

@bedward70 can't you just provide true to Reduced if you don't really need the input? It seems that these two classes are duplicating each other: Reduced and Folded

@bedward70
Copy link
Contributor Author

@yegor256 I double-checked and did not see the way to unite Reduced and Folded.
I think we need these classes:

  1. Reduced is a hoarder;
  2. Folded is a selector of the best.

@0crat
Copy link
Collaborator

0crat commented Dec 6, 2017

@kkamkou this job was assigned to you 8 days ago. It will be taken away from you soon, unless you close it, see par.8.

Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
Repository owner deleted a comment from 0crat Jan 8, 2018
@yegor256
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jan 11, 2018

@rultor merge

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

@rultor
Copy link
Collaborator

rultor commented Jan 11, 2018

@rultor merge

@bedward70 @yegor256 Oops, I failed. You can see the full log here (spent 8min)

308/560 KB   115/115 KB   391/391 KB              
312/560 KB   115/115 KB   391/391 KB   
316/560 KB   115/115 KB   391/391 KB   
320/560 KB   115/115 KB   391/391 KB   
324/560 KB   115/115 KB   391/391 KB   
328/560 KB   115/115 KB   391/391 KB   
332/560 KB   115/115 KB   391/391 KB   
336/560 KB   115/115 KB   391/391 KB   
340/560 KB   115/115 KB   391/391 KB   
344/560 KB   115/115 KB   391/391 KB   
348/560 KB   115/115 KB   391/391 KB   
352/560 KB   115/115 KB   391/391 KB   
356/560 KB   115/115 KB   391/391 KB   
360/560 KB   115/115 KB   391/391 KB   
364/560 KB   115/115 KB   391/391 KB   
368/560 KB   115/115 KB   391/391 KB   
                                       
Downloaded: https://repo.maven.apache.org/maven2/org/glassfish/web/javax.el/2.2.4/javax.el-2.2.4.jar (115 KB at 334.8 KB/sec)
372/560 KB   391/391 KB                
376/560 KB   391/391 KB   
380/560 KB   391/391 KB   
384/560 KB   391/391 KB   
388/560 KB   391/391 KB   
392/560 KB   391/391 KB   
396/560 KB   391/391 KB   
400/560 KB   391/391 KB   
                          
Downloaded: https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-guice/3.2.5/sisu-guice-3.2.5-no_aop.jar (391 KB at 1115.2 KB/sec)
404/560 KB                
408/560 KB   
412/560 KB   
416/560 KB   
420/560 KB   
424/560 KB   
428/560 KB   
432/560 KB   
436/560 KB   
440/560 KB   
444/560 KB   
448/560 KB   
452/560 KB   
456/560 KB   
460/560 KB   
464/560 KB   
468/560 KB   
472/560 KB   
476/560 KB   
480/560 KB   
484/560 KB   
488/560 KB   
492/560 KB   
496/560 KB   
500/560 KB   
504/560 KB   
508/560 KB   
512/560 KB   
516/560 KB   
520/560 KB   
524/560 KB   
528/560 KB   
532/560 KB   
536/560 KB   
540/560 KB   
544/560 KB   
548/560 KB   
552/560 KB   
556/560 KB   
560/560 KB   
             
Downloaded: https://repo.maven.apache.org/maven2/org/hibernate/hibernate-validator/5.0.0.Final/hibernate-validator-5.0.0.Final.jar (560 KB at 1344.6 KB/sec)
log4j:WARN No appenders could be found for logger (com.puppycrawl.tools.checkstyle.ConfigurationLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[INFO] Checkstyle: src/test/java/org/cactoos/scalar/HighestOfTest.java[4]: Line does not match expected header line of ' * Copyright (c) 2017-2018 Yegor Bugayenko'. (HeaderCheck)
[INFO] Checkstyle: src/test/java/org/cactoos/scalar/LowestOfTest.java[4]: Line does not match expected header line of ' * Copyright (c) 2017-2018 Yegor Bugayenko'. (HeaderCheck)
[INFO] Checkstyle: src/main/java/org/cactoos/scalar/HighestOf.java[4]: Line does not match expected header line of ' * Copyright (c) 2017-2018 Yegor Bugayenko'. (HeaderCheck)
[INFO] Checkstyle: src/main/java/org/cactoos/scalar/LowestOf.java[4]: Line does not match expected header line of ' * Copyright (c) 2017-2018 Yegor Bugayenko'. (HeaderCheck)
[INFO] Checkstyle: src/main/java/org/cactoos/scalar/Folded.java[4]: Line does not match expected header line of ' * Copyright (c) 2017-2018 Yegor Bugayenko'. (HeaderCheck)
[INFO] Read our quality policy: http://www.qulice.com/quality.html
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:17 min
[INFO] Finished at: 2018-01-11T11:15:50+00:00
[INFO] Final Memory: 43M/473M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.qulice:qulice-maven-plugin:0.17.1:check (jcabi-check) on project cactoos: Failure: There are 5 violations -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.qulice:qulice-maven-plugin:0.17.1:check (jcabi-check) on project cactoos: Failure
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: Failure
	at com.qulice.maven.CheckMojo.doExecute(CheckMojo.java:72)
	at com.qulice.maven.AbstractQuliceMojo.execute(AbstractQuliceMojo.java:172)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 20 more
Caused by: com.qulice.spi.ValidationException: There are 5 violations
	at com.qulice.maven.CheckMojo.run(CheckMojo.java:115)
	at com.qulice.maven.CheckMojo.doExecute(CheckMojo.java:66)
	... 23 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
container 29e87c1e2d2b93273489dfd79d35f56ba8e191a8e421026934a3aae427eb76bf is dead
Thu Jan 11 12:16:59 CET 2018

@0crat
Copy link
Collaborator

0crat commented Jan 15, 2018

@AllanWS/z resigned from #477, please stop working

@bedward70
Copy link
Contributor Author

@llorllale I have done. I split the PR to 3 PRs:

  1. MaxOf and MinOf #460 Bring back implementation of Folded: #460 Bring back implementation of Folded #477.
  2. MaxOf and MinOf #460 Bring back Max implementation but rename to HighestOf: #460 HighestOf + unit tests #575;
  3. MaxOf and MinOf #460 Bring back Min implementation but rename to LowestOf: #460 LowestOf + unit test #576.

*
* @author Eduard Balovnev (bedward70@mail.ru)
* @version $Id$
* @since 0.10
Copy link
Contributor

Choose a reason for hiding this comment

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

please change to 1.0

public final class FoldedTest {

@Test(expected = NoSuchElementException.class)
public void emptyListTest() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

Take a look at the method names of other tests in cactoos to get an idea of how test methods should be named. For example, this one could be called "failsForEmptyIterable"

"Can't find the single",
new Folded<>(
(first, last) -> first,
new IterableOf<Scalar<Integer>>((Scalar<Integer>) () -> single)
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a lot of "generics" noise in this line (and several others further down). Can the diamond operator be used?

(first, last) -> first,
new IterableOf<Scalar<Integer>>((Scalar<Integer>) () -> single)
)
.value(),
Copy link
Contributor

@llorllale llorllale Jan 24, 2018

Choose a reason for hiding this comment

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

can you attach this .value() to the closing parenthesis? Do the same for all other occurrences

@llorllale
Copy link
Contributor

Thank you @bedward70, looks better. Check the comments I just dropped now for a few details regarding the test class.

@llorllale
Copy link
Contributor

@bedward70 are you working on this?

@bedward70
Copy link
Contributor Author

bedward70 commented Jan 26, 2018

@llorllale Yes, but I can't check after merge master. See details:

java.lang.AssertionError: Can't calculate the file's MD5 checksum
Expected: Text with "842a5e7012d76e1df96c3d92e5c661df"
but: was org.cactoos.text.HexOf@2173f6d9

at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.cactoos.io.Md5DigestOfTest.checksumFromFile(Md5DigestOfTest.java:74)

java.lang.AssertionError: Can't calculate the file's SHA-1 checksum
Expected: Text with "9d47e35afdcbf845aa9f05f15b4d936b97e55f0e"
but: was org.cactoos.text.HexOf@4abdb505

at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.cactoos.io.Sha1DigestOfTest.checksumFromFile(Sha1DigestOfTest.java:74)

java.lang.AssertionError: Can't calculate the file's SHA-256 checksum
Expected: Text with "a56c3be45f9be8dda0653e33ae7ef3abf2939f926eda801f329e0830b6e7cc22"
but: was org.cactoos.text.HexOf@29b5cd00

at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.cactoos.io.Sha256DigestOfTest.checksumFromFile(Sha256DigestOfTest.java:76)

@llorllale
Copy link
Contributor

@bedward70 you're right - master is broken

@llorllale
Copy link
Contributor

@bedward70 I've opened #580 for this. In the meanwhile, can you work around the error? Perhaps temporarily @Ignore the tests? Just make sure not to commit it!

@bedward70
Copy link
Contributor Author

@llorllale I have fixed the findings. Thank you for your patience. :)

@llorllale
Copy link
Contributor

@yegor256 please merge

@0crat
Copy link
Collaborator

0crat commented Jan 27, 2018

The user @llorllale/z resigned from #477, please stop working

@0crat
Copy link
Collaborator

0crat commented Jan 27, 2018

The job #477 assigned to @driver733/z. The budget is 30 minutes, see §4. Please, read §8 and §9. If the task is not clear, read this and this.

@driver733
Copy link
Contributor

@yegor256 I believe this PR is ready to be merged as per the discussion.
#477 (comment)

@driver733
Copy link
Contributor

@0crat waiting

@0crat
Copy link
Collaborator

0crat commented Jan 28, 2018

@0crat waiting (here)

@driver733 The impediment for #477 was registered successfully by @driver733/z

@yegor256
Copy link
Owner

@0crat status

@0crat
Copy link
Collaborator

0crat commented Jan 29, 2018

@0crat status (here)

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

@yegor256
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jan 29, 2018

@rultor merge

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

@rultor rultor merged commit 3dd28a3 into yegor256:master Jan 29, 2018
@rultor
Copy link
Collaborator

rultor commented Jan 29, 2018

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 10min)

@0crat
Copy link
Collaborator

0crat commented Jan 29, 2018

Order was successfully finished: +30 points just awarded to @driver733/z, total is +30

@0crat
Copy link
Collaborator

0crat commented Jan 29, 2018

Payment to ARC for a closed pull request, as in §28: +15 points just awarded to @yegor256/z, total is +8670

@0crat
Copy link
Collaborator

0crat commented Jan 29, 2018

The job #477 is now out of scope

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.

7 participants