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 — Releases · google/google-java-format

Releases · google/google-java-format

v2.0.0

v2.0.0 Latest
Latest
@github-actions github-actions released this 30 Oct 13:04
v2.0.0
246202f

google-java-format 2.0.0 replaces the formatter's layout engine, and makes some improvements to lambda formatting (#19). This release also adds an optional cleanup pass that makes small non-whitespace changes, which is enabled by default.

Because of these changes, 2.0.0 reformats more existing code than a typical release. We recommend reformatting your codebase in a single commit when upgrading.

Formatting changes

  • A lambda that is the only argument of a call is now kept on the same line as the call, instead of starting on a new line with an extra level of indentation (#19):

    executor.submit(() -> {
      doSomething();
    });
  • Text blocks are now indented as part of the main formatting pass, so their indentation is correct even with --skip-reflowing-long-strings.

  • Fixed indentation of comments after assert, enum constants, for initializers, try resources, multi-catch clauses, and type arguments.

Cleanups

  • Added a --cleanup flag, enabled by default, for small non-whitespace changes:

    • removing redundant semicolons
    • removing empty annotation parentheses (@Foo() → @Foo)
    • removing parentheses around a single untyped lambda parameter ((x) -> ... → x -> ...) (#762)

    Cleanups only apply to the ranges being formatted. Use --cleanup=false to only change whitespace (and the existing --skip-sorting-imports, --skip-removing-unused-imports, and --skip-reordering-modifiers flags for the other non-whitespace changes).

  • When formatting a range with --lines or --offset and cleanups enabled, unformatted statements outside the range are re-indented to match the formatted output, so an edit that adds or removes a level of nesting doesn't leave the surrounding code misaligned. Blank lines left behind by cleanups are removed.

Configuration

  • --max-line-length=N sets the column limit (default 100) (#425). (This flag was introduced in v1.37.0)

Language support

  • Support value classes and value records (JEP 401: Value Objects (Preview))

Javadoc

  • Strip trailing asterisks before */ (#67).
  • Preserve relative indentation in <pre>{@code ...} blocks without leading *.
  • Join hyphenated words broken across lines.

Long strings

  • When formatting a range with --lines or --offset, only long string literals in the requested range are reflowed (#1114).
  • Escaped backslashes (e.g. \\t in a Windows path or a regular expression) are no longer split when reflowing long string literals (#1186, #1253, #1439).
  • Failures while reflowing long strings are reported as errors instead of crashing or hanging the CLI (#1439).

Other fixes

  • Fixed formatting in the Eclipse plugin, which failed with NoClassDefFoundError since 1.36.0 because the plugin didn't bundle commonmark (#1428).
  • The error for combining --dry-run with --replace now names the right flag (#1094).

API changes

  • JavaFormatterOptions.Builder.cleanup(boolean) controls the new cleanup pass, and defaults to true. This means Formatter.formatSource now makes the non-whitespace changes listed above by default. Integrations that format code the user is editing, e.g. format-on-save in an IDE, should set cleanup(false); the IntelliJ plugin does this.
  • Formatter.getFormatReplacements is now strictly whitespace-only: it no longer reorders modifiers, and never applies cleanups. Use Formatter.formatSource(String, Collection<Range<Integer>>) to format character ranges with modifier reordering.
  • JavaFormatterOptions.Style became a record in 1.37.0. The enum-compatible methods, such as Style.valueOf(String), have been restored for tools like Spotless that called them (#1478).
  • The previous layout engine's classes (com.google.googlejavaformat.Doc, OpsBuilder, and related types) are no longer used to format Java, but are still included for other formatters that build on them.

Full Changelog: v1.37.0...v2.0.0

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

msridhar and hoanhophuoc reacted with thumbs up emoji jonahsnider, nico-arianto, korthout, sormuras, and julemand101 reacted with hooray emoji
All reactions
  • 👍 2 reactions
  • 🎉 5 reactions
7 people reacted

v1.37.0

v1.37.0
@github-actions github-actions released this 01 Oct 12:05
v1.37.0
d346693

Changes:

  • Add a --max-line-length flag (#425)
  • Markdown javadoc formatting improvements (c51d691, ecba4fb)
  • Add --google-style and --style=google|aosp flags for easier switching between Google and AOSP style (#1415)

Full Changelog: v1.36.1...v1.37.0

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

nico-arianto reacted with thumbs up emoji mkurz, sormuras, JamesPaceOnTailwind, alex-bakker-tailwind, and amaroangelica369-pixel reacted with heart emoji
All reactions
  • 👍 1 reaction
  • ❤️ 5 reactions
6 people reacted

v1.36.1

v1.36.1
@github-actions github-actions released this 30 Jul 18:46
v1.36.1
a95a529

What's Changed

  • Fix an issue with formatting indented list items.
  • Handle blank lines before and within Markdown lists more accurately.

Full Changelog: v1.36.0...v1.36.1

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

nico-arianto and Haszyk11 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
2 people reacted

v1.36.0

v1.36.0
@github-actions github-actions released this 29 Jul 19:25
v1.36.0
a2145ce

Changes:

  • Significant improvements to Markdown Javadoc support

Full Changelog: v1.35.0...v1.36.0

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

sureshg, mkurz, and Sachinrajak8663 reacted with rocket emoji
All reactions
  • 🚀 3 reactions
3 people reacted

v1.35.0

v1.35.0
@github-actions github-actions released this 03 Mar 09:42
v1.35.0
cdd8a84

Changes:

  • Improved support for latest JDK 27 EA builds (075e025)

Full Changelog: v1.34.1...v1.35.0

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

nico-arianto, sormuras, bondj, and Abega1642 reacted with thumbs up emoji sureshg and Damohi101 reacted with rocket emoji
All reactions
  • 👍 4 reactions
  • 🚀 2 reactions
6 people reacted

v1.34.1

v1.34.1
@github-actions github-actions released this 04 Feb 19:43
v1.34.1
64ee627

Changes:

  • Fix reflection configuration for GraalVM native binaries (#1327)

Full Changelog: v1.34.0...v1.34.1

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

sureshg, nico-arianto, fp024, malvai5005-png, and beingme8583-netizen reacted with rocket emoji
All reactions
  • 🚀 5 reactions
5 people reacted

v1.34.0

v1.34.0
@github-actions github-actions released this 03 Feb 09:37
v1.34.0
1d7adff

Changes:

  • Support Java 25 Instance Main Methods (#1216)

Full Changelog: v1.33.0...v1.34.0

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

nico-arianto reacted with thumbs up emoji sureshg reacted with rocket emoji
All reactions
  • 👍 1 reaction
  • 🚀 1 reaction
2 people reacted

v1.33.0

v1.33.0
@github-actions github-actions released this 05 Dec 08:39
v1.33.0
6252f4e

This release contains no formatting changes.

The constructors of the com.google.googlejavaformat.java.filer.FormattingFiler API are now deprecated, and the new factory method FormattingFiler#create(ProcessingEnvironment) should be used instead.

Full Changelog: v1.32.0...v1.33.0

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

nico-arianto, mklinkj, and SentryMan reacted with thumbs up emoji aclfe, zina-cebotari, and SentryMan reacted with hooray emoji
All reactions
  • 👍 3 reactions
  • 🎉 3 reactions
5 people reacted

v1.32.0

v1.32.0
@github-actions github-actions released this 28 Oct 10:26
v1.32.0
20fbee0

Changes:

  • Add support for AOSP formatting in the Eclipse plugin (#179)

Full Changelog: v1.31.0...v1.32.0

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

nico-arianto, someone5678, sormuras, and Ray784 reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
4 people reacted

v1.31.0

v1.31.0
@github-actions github-actions released this 27 Oct 10:27
v1.31.0
e5f4c54

This release contains no formatting changes.

Changes:

  • Add a SnippetFormatter(JavaFormatterOptions) constructor (8c30268)

Full Changelog: v1.30.0...v1.31.0

Assets 11
Loading

Uh oh!

There was an error while loading. Please reload this page.

All reactions
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.