Skip to content

Inconsistent formatting (first pass, second pass results in a different output). #1260

@dweiss

Description

@dweiss

This class:

class Xyz {
  void foo() {
    int i = 0;
switch (i) {
          case 18:
            { /* Break so we don't hit fall-through warning: */ break;/* ignore STRING */
            }
          }}}

results in a different output when you run gjf multiple times:

$ java -jar google-java-format-1.27.0-all-deps.jar src.java > 1.java
$ java -jar google-java-format-1.27.0-all-deps.jar 1.java > 2.java
$ diff 1.java 2.java 
7c7
<             /* Break so we don't hit fall-through warning: */
---
>           /* Break so we don't hit fall-through warning: */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions