Skip to content

Debugging in one-line lambdas does not workΒ #1546

@fhuonder

Description

@fhuonder

Hi

My versions:

  • vscode: 1.99.2
  • vscode-java-debug: 0.58.1
  • Language Support for Java(TM) by Red Hat: 1.41.1
  • JDK 24
  • vscode devcontainer
  • Maven project

I cannot debug one-line lambdas.

This is how the code looks like as soon as I start the application:
Image

As you can see, the two breakpoints where the lambda is a one-liner are grayed out (unverified breakpoint).
The execution does not stop there but it stops at the other breakpoints.
The one-liner breakpoints are created as inline breakpoints.

My assumption is that this is a bug.

Here the code to take and paste somewhere:

public String createMessage() {
    return Stream.of("Hello", " World", " - ", "What's", " up?")
    .map(token -> token + "1")
    .map(token -> {return token + "2";})
    .map(token -> {
        String result = token.substring(0, token.length() - 2);
        return result;
    })
    .collect(Collectors.joining());
}

Would be nice if this could be fixed or if someone can tell me what I'm doing wrong.

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