Title: Remove redundant semicolons (top level, class/enum bodies, statements) · Issue #156 · openjavaformat/open-java-format · GitHub
Open Graph Title: Remove redundant semicolons (top level, class/enum bodies, statements) · Issue #156 · openjavaformat/open-java-format
X Title: Remove redundant semicolons (top level, class/enum bodies, statements) · Issue #156 · openjavaformat/open-java-format
Description: Upstream: google/google-java-format#1491 Kind: idea | Priority: low google-java-format#1491 (merged 2026-10-22, copybara export) extends the --cleanup AST pass from google-java-format#1492 so that stray ; are deleted at top level, in cla...
Open Graph Description: Upstream: google/google-java-format#1491 Kind: idea | Priority: low google-java-format#1491 (merged 2026-10-22, copybara export) extends the --cleanup AST pass from google-java-format#1492 so that ...
X Description: Upstream: google/google-java-format#1491 Kind: idea | Priority: low google-java-format#1491 (merged 2026-10-22, copybara export) extends the --cleanup AST pass from google-java-format#1492 so that ...
Opengraph URL: https://github.com/openjavaformat/open-java-format/issues/156
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remove redundant semicolons (top level, class/enum bodies, statements)","articleBody":"**Upstream:** https://github.com/google/google-java-format/pull/1491 \n**Kind:** idea | **Priority:** low\n\n[google-java-format#1491](https://github.com/google/google-java-format/pull/1491) (merged 2026-10-22, copybara export) extends the `--cleanup` AST pass from [google-java-format#1492](https://github.com/google/google-java-format/pull/1492) so that stray `;` are deleted at top level, in class and enum bodies, and as empty statements in blocks. Upstream also moves several existing goldens (for example the semicolon-in-class case) into a \"changed by cleanup\" set.\n\nWhy it matters: our formatter keeps these semicolons, e.g. our golden `SemicolonInClass` still outputs a lone `;` inside the class. It is a harmless tidy-up with a small footprint, but like brace insertion it is a non-whitespace rewrite and should only come with an opt-out.\n\nExamples: not available - the diff shows only the removal of the `;`, not the resulting layout of the emptied body in our formatter; our current output keeps the lone `;` as in the golden above.\n\nAffected files in our repo:\n- open-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java (`visitEmptyStatement`, class body member handling)\n- open-java-format/src/test/resources/com/palantir/javaformat/java/testdata/SemicolonInClass.input and .output\n\nSuggested action: watch / adopt-the-idea together with the brace-insertion ticket; low priority on its own.\n\n---\n_Filed from an upstream-watch ticket after manual review._","author":{"url":"https://github.com/abashev","@type":"Person","name":"abashev"},"datePublished":"2026-10-25T19:18:58Z","url":"https://github.com/openjavaformat/open-java-format/issues/156"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fb2da3dc-b6fc-a796-b305-07f06d4cc8af |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E1FC:83E6C:3C1A49:518443:6AFBB795 |
| html-safe-nonce | bd2d4b9cdd89cd8c34abb7bf4e9eb2fac6c60f13c0d4633acc672c2918befd1e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUZDOjgzRTZDOjNDMUE0OTo1MTg0NDM6NkFGQkI3OTUiLCJ2aXNpdG9yX2lkIjoiNTg2MjA4NTc1NDY4Njc4MTMzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d811fc0bac4f6046b297af27815fdf6e3a338f7933716a16e9ec9e58b744d632 |
| hovercard-subject-tag | issue:6028291226 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/openjavaformat/open-java-format/156/issue_layout |
| twitter:image | https://opengraph.githubassets.com/772a393c8b25e9226ceeb44585b5f7df7b02525f37aea0eef8a0de3bed6502b3/openjavaformat/open-java-format/issues/156 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/772a393c8b25e9226ceeb44585b5f7df7b02525f37aea0eef8a0de3bed6502b3/openjavaformat/open-java-format/issues/156 |
| og:image:alt | Upstream: google/google-java-format#1491 Kind: idea | Priority: low google-java-format#1491 (merged 2026-10-22, copybara export) extends the --cleanup AST pass from google-java-format#1492 so that ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | abashev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c |
| turbo-cache-control | no-preview |
| go-import | github.com/openjavaformat/open-java-format git https://github.com/openjavaformat/open-java-format.git |
| octolytics-dimension-user_id | 325177626 |
| octolytics-dimension-user_login | openjavaformat |
| octolytics-dimension-repository_id | 1288055459 |
| octolytics-dimension-repository_nwo | openjavaformat/open-java-format |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 214273098 |
| octolytics-dimension-repository_parent_nwo | palantir/palantir-java-format |
| octolytics-dimension-repository_network_root_id | 214273098 |
| octolytics-dimension-repository_network_root_nwo | palantir/palantir-java-format |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e4cce0e99cf61481a318ff12c2e8580153a6c7c6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width