Skip to content
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

Allow empty lambdas to not have whitespace #615

Closed
mccheah opened this issue Apr 18, 2019 · 4 comments
Closed

Allow empty lambdas to not have whitespace #615

mccheah opened this issue Apr 18, 2019 · 4 comments

Comments

@mccheah
Copy link

mccheah commented Apr 18, 2019

What happened?

The following code produces an error in checkstyle:

args.forEach(arg -> {});

Checkstyle will complain and ask for this:

args.forEach(arg -> { });

What did you want to happen?

It seems reasonable for empty lambdas to not have any whitespace. This is similar to empty method bodies in private constructors, for example.

@schlosna
Copy link
Contributor

schlosna commented May 7, 2019

@mccheah do you have a more realistic example? It feels like any no-op like this (forEach, Runnable) etc. is a bit odd as you’re just burning CPU cycles.

@carterkozak
Copy link
Contributor

@mccheah
Copy link
Author

mccheah commented May 7, 2019

The issue linked above in Iceberg shows where we're concerned: apache/iceberg#153 (comment)

@iamdanfox
Copy link
Contributor

Fixed here #715

baseline 1.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants