GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cleanup pass: remove parentheses around a single untyped lambda parameter · Issue #216 · openjavaformat/open-java-format

Cleanup pass: remove parentheses around a single untyped lambda parameter #216

New issue
Copy link
New issue
Copy link
Open
Open
Cleanup pass: remove parentheses around a single untyped lambda parameter#216
Copy link

Description

@abashev
abashev
opened on Nov 12, 2026
Issue body actions

Upstream: google/google-java-format#1505
Kind: idea | Priority: low

google-java-format#1505 (merged 2026-10-29, copybara export) teaches the --cleanup pass to rewrite (x) -> x as x -> x. Comments inside the parentheses are preserved, and a space is added when the opening parenthesis follows an identifier (return(x) -> x). It answers the old request google-java-format#762, which was closed on 2026-10-29.

Why it matters: a common style nit that our formatter leaves alone. Like the other cleanup tickets it only makes sense if we add an AST cleanup pass.

Before (upstream behaviour before the change; I believe ours keeps the parentheses but did not run it):

class T {
  Function<Integer, Integer> f = (x) -> x + 1;
  Runnable r = () -> {};
}

After (with the change, from the upstream description):

class T {
  Function<Integer, Integer> f = x -> x + 1;
  Runnable r = () -> {};
}

Affected files in our repo:

  • open-java-format/src/main/java/com/palantir/javaformat/java/Formatter.java (where a cleanup pass would be wired in)

Suggested action: watch together with the other cleanup tickets; only typed or multi-parameter lambdas must keep their parentheses.


Filed from an upstream-watch ticket after manual review.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.