Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Remove parentheses for single parameter lambda

Open
#762 2 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

Review the lambda-formatting path and the OpsBuilder behavior mentioned in the issue. Determine whether single-parameter lambdas should be emitted without parentheses while preserving the formatter's design constraints. Done means reaching a clear decision and, if accepted, defining the expected formatting behavior and its tests.

Written by the indexing model from the issue text.

Description

non-whitespace

I understand this is probably against the design philosophy, but I would like to get it confirmed if that is the case.

It is generally considered to be a bette practice omitting parentheses for single parameter lambda, for example foo -> ... is better than (foo) -> ..., from readability perspective.

I tried hacking around and could get it to work, but I had to ignore a token by adding a new method to OpsBuilder, so either I'm doing something wrong or this is very much against the design philosophy (respecting original input as much as possible, IIUC).

Could you please help me understand whether this is a valid feature request or not? Thank you very much.

Dominant language
Java
Stars
6.2k
Forks
936
Avg merge
6m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/google-java-format

All issues in google/google-java-format

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.