Skip to content

Chain<T>.uniq(Function1<T, F>) should return Iterable<T>, not Iterable<F>. #91

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

Merged
merged 2 commits into from
Apr 2, 2017

Conversation

psobot
Copy link
Contributor

@psobot psobot commented Apr 2, 2017

$.uniq(Function1<T, F>) returns an Iterable<T>, by using F as the uniqueness parameter. However, when using Chain, Chain.uniq(Function1<T, F>) returns an Iterable<F>. This PR fixes that and adds a test (in ChainingTest) to validate this behaviour.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 8689281 on psobot:fix-chaining-uniq-by into 3bc6e48 on javadev:master.

1 similar comment
@coveralls
Copy link

coveralls commented Apr 2, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 8689281 on psobot:fix-chaining-uniq-by into 3bc6e48 on javadev:master.

@psobot psobot force-pushed the fix-chaining-uniq-by branch from 8689281 to d37791d Compare April 2, 2017 02:57
@coveralls
Copy link

coveralls commented Apr 2, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling d37791d on psobot:fix-chaining-uniq-by into 3bc6e48 on javadev:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling d37791d on psobot:fix-chaining-uniq-by into 3bc6e48 on javadev:master.

@codecov
Copy link

codecov bot commented Apr 2, 2017

Codecov Report

Merging #91 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             master    #91   +/-   ##
=======================================
  Coverage       100%   100%           
  Complexity       40     40           
=======================================
  Files             3      3           
  Lines            52     52           
  Branches          4      4           
=======================================
  Hits             52     52
Impacted Files Coverage Δ Complexity Δ
.../java/com/github/underscore/examples/Optional.java
src/main/java/com/github/underscore/Optional.java 100% <0%> (ø) 32% <0%> (?)

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 3bc6e48...c30878a. Read the comment docs.

@SuppressWarnings("unchecked")
public void chain8() {
final List<Comparable> result = $.chain($.chain($.class.getDeclaredMethods())
.reduce(new FunctionAccum<List<String>, Method>() {
Copy link
Owner

@javadev javadev Apr 2, 2017

Choose a reason for hiding this comment

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

Hi,

Thanks for your improvements!

It may be map() method here instead of reduce().

@coveralls
Copy link

coveralls commented Apr 2, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling c30878a on psobot:fix-chaining-uniq-by into 3bc6e48 on javadev:master.

@javadev javadev merged commit 28a7ae7 into javadev:master Apr 2, 2017
@javadev javadev added this to the v1.25 milestone Apr 2, 2017
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.

3 participants