Reformats Java source code to comply with Google Java Style.
--add-exports
flags on the command line is no longer necessary for JDK 17 and newer (https://github.com/google/google-java-format/commit/ee81afc93990493701a6f7a2801eff058ac57891)Full Changelog: https://github.com/google/google-java-format/compare/v1.14.0...v1.15.0
non-
(#696)R
classes (16e72a1a9bbf182fac6686807e54bc846a9543ed)Full Changelog: https://github.com/google/google-java-format/compare/v1.13.0...v1.14.0
Full Changelog: https://github.com/google/google-java-format/compare/v1.12.0...v1.13.0
Full Changelog: https://github.com/google/google-java-format/compare/v1.11.0...v1.12.0
google-java-format
now has improved support for running on JDK 17 early access builds.
Changes:
final
variables in instanceof
patterns (#588)instanceof
pattern handling (#594)sealed
classes (#603)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:
;
in import lists (https://github.com/google/google-java-format/commit/b769e812a052d7cff4a2d86eff4981a5d358ee2d)-
and negative literals (https://github.com/google/google-java-format/commit/6da736d786ac71a134ed6cc43e9cd825c83de0fd)yield
statements (#489)Changes:
--skip-javadoc-formatting
).Fixes
Changes
.stream()
as a syntactic unitFeatures
//$NON-NLS-x$
comments (#221)--assume-filename
Incompatible changes
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