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
Implement java.util.function.Consumer
.
#3916
Conversation
1d1943e
to
fb29635
Compare
Thanks for the PR. Could you please target it to the 0.6.x branch instead of master? We periodically merge 0.6.x into master, but never the other way around.
|
makeConsumer[Any](x => throw new AssertionError(s"dontCallConsumer.accept($x)")) | ||
|
||
assertThrows(classOf[ThrowingConsumerException], | ||
throwingConsumer.andThen(dontCallConsumer).accept(0)) |
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.
This line should have 4 spaces of indentation instead of 2.
throwingConsumer.andThen(dontCallConsumer).accept(0)) | ||
|
||
assertThrows(classOf[ThrowingConsumerException], | ||
add.andThen(throwingConsumer).accept(1)) |
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.
This line should have 4 spaces of indentation instead of 2.
fb29635
to
dc88f55
Compare
Thanks. The CI got confused because you changed the base branch only after force-pushing. You can fix the situation by doing a no-op |
dc88f55
to
be9da4d
Compare
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.
Thanks for the updates!
I just noticed two blank lines that should not be there according to our coding style. Sorry, I didn't see them earlier while reviewing on my mobile.
Could you remove them and amend your commit? After that it's good to go.
} | ||
} | ||
} | ||
|
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.
This blank line should not exist. (There should be one New Line at the end of the file, but no empty line.)
} | ||
} | ||
} | ||
|
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.
This blank line should not exist. (There should be one New Line at the end of the file, but no empty line.)
be9da4d
to
7fd9ebb
Compare
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.
Thank you :)
Glad to contribute, thanks for reviewing. |
This PR implements
java.util.function.Consumer
. I implemented the class based on the Java 8 Javadocs and did not look at any existing implementations. The tests are patterned after the existing Scala.js tests for Predicate.The motivation for implementing the class is that it is required by the Akka.js CircuitBreaker, which is required to implement circuit breakers in Lagom.js.