Skip to content

Line break between instanceof and final #605

@benediktsatalia

Description

@benediktsatalia

Prettier-Java 2.3.1

# Options (if any):
--print-width 80

Input:

  public boolean test(final Object obj) {
    return obj instanceof final Integer x && (x == 5 || x == 6 || x == 7 || x == 8 || x == 9 || x == 10 || x == 11);
  }

Output:

  public boolean test(final Object obj) {
    return (
      obj instanceof
      final Integer x &&
      (x == 5 || x == 6 || x == 7 || x == 8 || x == 9 || x == 10 || x == 11)
    );
  }

Expected behavior:

  public boolean test(final Object obj) {
    return (
      obj instanceof final Integer x &&
      (x == 5 || x == 6 || x == 7 || x == 8 || x == 9 || x == 10 || x == 11)
    );
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions