Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: google/google-java-format
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.22.0
Choose a base ref
...
head repository: google/google-java-format
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.23.0
Choose a head ref
  • 13 commits
  • 34 files changed
  • 4 contributors

Commits on Apr 6, 2024

  1. Support overlapping --lines ranges in google-java-format.

    The strict behavior comes from the underlying ImmutableRangeSet.Builder class, which does not allow overlapping ranges to be added. Let's use TreeRangeSet instead.
    
    I have also updated the documentation for the --lines flag to make it clear that the line numbers are a closed-closed interval.
    
    Tested with:
    ```
    blaze run :google_java_format_binary -- --lines=1:5 --lines=3:8 - < Foo.java
    ```
    
    Before this CL the command fails with:
    ```
    '--lines=1:5' '--lines=3:8' -
    Overlapping ranges not permitted but found [0..5) overlapping [2..8)
    ```
    
    After this CL the command succeeds.
    
    PiperOrigin-RevId: 622410610
    java-team-github-bot authored and google-java-format Team committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    c4b467d View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2024

  1. update the IntelliJ plugin to 1.22.0

    PiperOrigin-RevId: 624993575
    plumpy authored and google-java-format Team committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    6e3b852 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2024

  1. Remove support for the String Templates preview feature

    Rollback of b5feefe, 38de9c4, e946e82
    
    See https://bugs.openjdk.org/browse/JDK-8329949
    
    PiperOrigin-RevId: 629182379
    cushon authored and google-java-format Team committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    fdf4b29 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. Add a test for trailing unicode escaped whitespace in text blocks

    PiperOrigin-RevId: 629785894
    cushon authored and google-java-format Team committed May 1, 2024
    Configuration menu
    Copy the full SHA
    bec248b View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. Handle classes with no members and semi-colons

    PiperOrigin-RevId: 638312117
    cushon authored and google-java-format Team committed May 29, 2024
    Configuration menu
    Copy the full SHA
    b9b6730 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2024

  1. Prepare g-j-f for some internal javac API changes

    * Refactor comment handling in tokenization to avoid extending javac's internal Comment. This prepares for upcoming JDK changes to the Comment API, which break the current subclass approach by changing the return type of `Comment#getPos`, see also similar changes to Error Prone in unknown commit
    * `JCCompilationUnit#getImports` no longer returns `JCImport`, as part of the changes for modular imports. Supporting modular imports is future work, this change just avoids a crash formatting the existing syntax on the latest JDK versions.
    
    PiperOrigin-RevId: 638669955
    cushon authored and google-java-format Team committed May 30, 2024
    Configuration menu
    Copy the full SHA
    0b384e3 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2024

  1. Automatic code cleanup.

    PiperOrigin-RevId: 639062534
    cushon authored and google-java-format Team committed May 31, 2024
    Configuration menu
    Copy the full SHA
    db08589 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. Fix modifier order handling for non-sealed

    `non-sealed` is tokenized as three tokens, the modifier sorting logic was assuming it would show up as a single token.
    
    PiperOrigin-RevId: 640534518
    cushon authored and google-java-format Team committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    7fd9300 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2024

  1. Adjust indentation of line comments inside expression switches

    For statement switches there's some ambiguity about whether a comment documents the previous or next case:
    
    ```
      case 1:
        // case 1 falls through to 2
      case 2:
        doSomething()
    ```
    
    ```
      // this is information about case 1
      case 1:
      // this is information about case 2
      case 2:
        doSomething()
    ```
    
    For expression switches there is no fall through, so assume that a line comments before a case label always apply to the case label after it.
    
    PiperOrigin-RevId: 644163145
    cushon authored and google-java-format Team committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    3affd63 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2024

  1. Adjust line comment indentation inside statement switches

    Follow-up to 3affd63
    
    Fixes #876
    
    PiperOrigin-RevId: 644190687
    cushon authored and google-java-format Team committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    f7543b2 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. Use JSpecify 1.0!

    PiperOrigin-RevId: 653332912
    cushon authored and google-java-format Team committed Jul 17, 2024
    1 Configuration menu
    Copy the full SHA
    1296f1d View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. Add customization for google-java-format arguments

    Setting google-java-format-arguments to `'("--aosp")` makes it easy to format on Android java files.
    
    PiperOrigin-RevId: 657263779
    java-team-github-bot authored and google-java-format Team committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    de57db5 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Configuration menu
    Copy the full SHA
    f1f6874 View commit details
    Browse the repository at this point in the history
Loading