Skip to content

Google formatter cause inline lambda issue #489

@gayanper

Description

@gayanper

Take the following example

  @org.junit.jupiter.api.Test
  void testMain1() {
    System.out.println();
    List<String> list =
        List.of("A", "1").stream().filter(
          a -> "1".equals(a)
        ).collect(Collectors.toList());

    assertEquals(1, list.size());
  }

I cannot add an inline breakpoint to a -> "1".equals(a), because it is considered as a line breakpoint. But at the same time line breakpoint doesn't check if this line is under a lambda and make it a lambda breakpoint. If I use a lambda block things works or format it like

  @org.junit.jupiter.api.Test
  void testMain1() {
    System.out.println();
    List<String> list =
        List.of("A", "1").stream().filter(a
          -> "1".equals(a)
        ).collect(Collectors.toList());

    assertEquals(1, list.size());
  }

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