Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jiminhsieh
Copy link
Contributor

  • 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.

@jiminhsieh jiminhsieh force-pushed the change-to-lambda-expression branch from e6d1233 to dd0b849 Compare May 20, 2018 09:28
anilgursel
anilgursel previously approved these changes May 21, 2018
Copy link
Collaborator

@anilgursel anilgursel left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@akara akara left a 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) => {
Copy link
Contributor

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(...)
    ...

Copy link
Contributor

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) => {
Copy link
Contributor

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) => {
Copy link
Contributor

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) => {
Copy link
Contributor

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.

Copy link
Contributor

@akara akara left a comment

Choose a reason for hiding this comment

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

LGTM

@anilgursel anilgursel merged commit e389265 into paypal:master May 22, 2018
@jiminhsieh jiminhsieh deleted the change-to-lambda-expression branch May 26, 2018 00:47
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