MINOR: Switch anonymous classes to lambda expressions in tools module#6013
MINOR: Switch anonymous classes to lambda expressions in tools module#6013mrsrinivas wants to merge 4 commits into
Conversation
|
ping @guozhangwang @bbejeck @hachikuji for review please. |
ryannedolan
left a comment
There was a problem hiding this comment.
FWIW, most of these aren't really lambda expressions by most definitions. My rule of thumb for these sort of single-method interfaces is:
- if it's a one-line expression with no side effects, use an inline lambda expression
- otherwise, write a private method and pass a method reference
i.e.
foo(this::bar)
instead of foo(...block of code ...)
my 2 cents.
ijuma
left a comment
There was a problem hiding this comment.
Thanks for the PR, left a few minor comments.
4d2562d to
69610c8
Compare
|
Thank you @ijuma for the review. I addressed all the comments except one. please let me know, if any changes needs to be done for it. |
69610c8 to
7ae6359
Compare
|
@omkreddy @vahidhashemian, could you review it when you got sometime ? |
|
retest this please |
|
Fixed the style errors in latest commit. Embedded previous builds status for tracking! cc: @omkreddy |
|
@mrsrinivas I also concur with @ryannedolan . For me, multi-line lambdas are hard to read/understand. But we can follow whatever best practice/convention is. |
|
We have been using multi-line lambdas in Scala for a while. Why are we introducing new restrictions for Java? |
|
@ijuma Fair point. I was just thinking about java code. I am fine with using multiline lambda as scala code. |
omkreddy
left a comment
There was a problem hiding this comment.
@mrsrinivas Thanks for the PR. LGTM.
Switch to lambda when ever possible instead of old anonymous way in tools module Author: Srinivas Reddy <srinivas96alluri@gmail.com> Author: Srinivas Reddy <mrsrinivas@users.noreply.github.com> Reviewers: Ryanne Dolan <ryannedolan@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Manikumar Reddy <manikumar.reddy@gmail.com> Closes apache#6013 from mrsrinivas/tools-switch-to-java8
Switch to lambda when ever possible instead of old anonymous way
in tools module
Committer Checklist (excluded from commit message)