google-java-format
google-java-format copied to clipboard
Reformats Java source code to comply with Google Java Style.
I would like to suggest a different formatting of switch expressions that are used as right-hand side of an assignment: move the `switch` on the same line as the assignment...
Hello, I found this issue when updating the formatter version in googleapis/java-spanner ```java package com.example; final class Test { // Error: unclosed string literal String breaks = "'\\d{2}):(\\d{2}):(\\d{2})(\\.\\d{1,9})?)([Zz]|([+-])(\\d{2}):(\\d{2})))|(READ_TIMESTAMP)[\\t"; // Works...
In https://github.com/enola-dev/enola/pull/974 for https://github.com/enola-dev/enola/issues/971 with https://github.com/enola-dev/enola/issues/970, I am using "Java's fancy modern main style", AKA the JEP 445 & 463 & 477 & 495 stuff: * https://openjdk.org/jeps/445 * https://openjdk.org/jeps/463 *...
The documentation for Using the formatter > IntelliJ/Android Studio/JetBrains IDEs states: "When enabled, the plugin fully replaces the native Reformat Code and Optimize Imports actions." This design prevents developers from...
Google-java-format when using AOSP style will reformat code that was already formatted by Google's Android Studio for Platform IDE (and vice versa). Both styles are compliant with the guidelines specified...
We have a string as: ```java // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Sample code: * {@code * // This snippet has been automatically generated and should be regarded as...
Consider the following code: ```java import java.nio.ByteBuffer; interface BufferAllocator { /// Returns a lease for a [ByteBuffer] with at least the specified [capacity][ByteBuffer#capacity]. LeasedByteBuffer getByteBuffer(long minCapacity); } ``` Formatting the...
This is a crude solution to support markdown javadoc comments by not touching anything that looks like one.
Consider the following code: ```java // this will import e.g. all the classes from package java.util, java.util.stream, java.io, java.lang, java.nio.file import module java.base; ``` When trying to use google-java-format 1.24.0,...
# Refactor JavacTokens to Address Design Smells ## Description This PR implements three refactorings in JavacTokens.java to address several identified design smells. The changes improve code organization and maintainability while...