Skip to content

Releases: google/google-java-format

v1.15.0

07 Mar 16:56
Compare
Choose a tag to compare

What's Changed

  • Passing --add-exports flags on the command line is no longer necessary for JDK 17 and newer (ee81afc)

Full Changelog: v1.14.0...v1.15.0

1.14.0

09 Feb 20:00
Compare
Choose a tag to compare

What's Changed

  • Handle modifiers that start with non- (#696)
  • Treat single-character upper case identifiers as UpperCamelCase, to improve formatting of Android R classes (16e72a1)
  • Don't format javadoc without a summary fragment as a single-line (668f108)

Full Changelog: v1.13.0...v1.14.0

1.13.0

19 Nov 23:06
Compare
Choose a tag to compare

What's Changed

  • Fix formatting of pattern matching in switch when running on Java 17 (#689, #690)

Full Changelog: v1.12.0...v1.13.0

1.12.0

20 Oct 20:34
Compare
Choose a tag to compare

What's Changed

  • Format type annotation as part of the type, not part of the modifiers list (#653)
  • Fix indentation of case statements on JDK 17 (#654)

Full Changelog: v1.11.0...v1.12.0

1.11.0

30 Jul 01:41
Compare
Choose a tag to compare

google-java-format now has improved support for running on JDK 17 early access builds.

Changes:

  • Handle final variables in instanceof patterns (#588)
  • Fix handling of annotations in compact record constructors (#574)
  • Fix a crash in instanceof pattern handling (#594)
  • Wrap multiple values in switch expression case (#540)
  • Fix formatting of module trees after JDK-8255464
  • Support sealed classes (#603)

1.10.0

31 Mar 22:08
Compare
Choose a tag to compare

google-java-format now supports running on JDK 16. The following flags are required when running on JDK 16, due to JEP 396: Strongly Encapsulate JDK Internals by Default:

java \
  --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
  --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
  --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
  --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
  --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
  -jar google-java-format-1.10.0-all-deps.jar T...

Other changes:

  • Handle extra ; in import lists (b769e81)
  • Add missing space between unary - and negative literals (6da736d)
  • Fix an off-by-one issue on the reflowing of string literals (b9fd8d2)

1.9

24 Aug 17:25
Compare
Choose a tag to compare
1.9
  • Add support for yield statements (#489)
  • Fix a crash in expression switches (#477)

1.8

01 May 20:31
Compare
Choose a tag to compare
1.8

Changes:

  • The minimum supported runtime version is now JDK 11.
  • Initial support for Java 14 language features, including preview features. (Only available when running the formatter on JDK 14 or newer.)
  • Flag control of javadoc formatting (--skip-javadoc-formatting).
  • Reflowing string literals that exceed the column limit.

Fixes

  • Handle unary negation when formatting tabular arguments (#400)
  • Remove trailing tabs from comments to make behavior idempotent (#422)
  • Fix a crash on c-style arrays in parameters (#374)
  • Fix import reorderer to handle single-line-comments in imports (f246638)
  • Handle double semi-colons after package statements (5e114ca)

1.7

09 Jan 23:47
Compare
Choose a tag to compare
1.7

Changes

  • Treat expressions ending in .stream() as a syntactic unit
  • Keep going if a file cannot be read, and report a non-zero exit status, similar to handling of syntax errors.

1.6

25 May 01:39
Compare
Choose a tag to compare
1.6

Features

  • Don't format annotations as block-like constructs (#159)
  • Add horizontal whitespace between varargs specifiers and type annotations (#282)
  • Don't add spaces to //$NON-NLS-x$ comments (#221)
  • Unify breaks between type parameters
  • Add support for --assume-filename

Incompatible changes

  • Version 1.6.1 of the IntelliJ plugin now notifies if google-java-format hasn't been configured for new projects. (Version 1.6.0 of the plugin enabled the formatter by default, but this behaviour was reverted in 1.6.1. See #290.)

Bug Fixes

  • Don't crash on empty enum declarations (#281)
  • Don't crash on unusual line separators (#201)