-
Notifications
You must be signed in to change notification settings - Fork 237
Lambda expression for Java 8 SAM types #660
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
Lambda expression for Java 8 SAM types #660
Conversation
jiminhsieh
commented
May 20, 2018
- Use Lambda expression instead of anonymous classes
- Use parallel compiler backend
- Title includes issue id.
- Description of the change added.
- Commits are squashed.
- Tests added.
- Documentation added/updated.
- Also please review CONTRIBUTING.md.
e6d1233
to
dd0b849
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.
LGTM
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.
Just minor cosmetic issues. Thanks so much for your help!
Resume | ||
} | ||
} | ||
(t: Throwable) => { |
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.
Just a style issue, I don't think you really need the parentheses or the curly braces in this line. The following should work. Please try...
t: Throwable =>
log.error(...)
...
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.
If you need to put the whole thing in curly braces, I'd do it at the def level:
def decider: akka.japi.function.Function[Throwable, Directive] = {
t: Throwable =>
...
Resume
}
private[this] val connectionStateListener: ConnectionStateListener = new ConnectionStateListener { | ||
override def stateChanged(client: CuratorFramework, newState: ConnectionState): Unit = { | ||
private[this] val connectionStateListener: ConnectionStateListener = | ||
(client: CuratorFramework, newState: ConnectionState) => { |
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.
Ditto, the {
at the end of this line should not be needed.
lazy val segmentWatcher: CuratorWatcher = new CuratorWatcher { | ||
override def process(event: WatchedEvent): Unit = { | ||
lazy val segmentWatcher: CuratorWatcher = | ||
(event: WatchedEvent) => { |
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.
Ditto.
lazy val partitionWatcher: CuratorWatcher = new CuratorWatcher { | ||
override def process(event: WatchedEvent): Unit = { | ||
lazy val partitionWatcher: CuratorWatcher = | ||
(event: WatchedEvent) => { |
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.
And just one more of the same.
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.
LGTM