Skip to content

Debugging in one-line lambdas does not work #1546

Description

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.

Activity

  1. chagong commented on Aug 13, 2025

    @chagong
    Contributor

    Florian Huonder (@fhuonder) can you recheck this issue? I can hit the breakpoints.

    Image Image
  2. fhuonder commented on Sep 20, 2025

    @fhuonder
    Author

    Hi,

    Sorry for my late response.
    The (inline) breakpoint on line 13 .map(token -> token + "1") is still not hit.

    The others work.

    I am on version 0.58.2.

    Regards,
    Florian

  3. github-actions commented on Nov 10, 2025

    @github-actions

    Hi Florian Huonder (@fhuonder), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    Workaround

    • VS Code’s Java debugger currently ignores column information for inline (one-line) lambdas, so breakpoints on those lambdas remain unverified.
    • Expand your lambda into a multi-line block and set the breakpoint on its own line. For example:
      .map(token -> {
          String temp = token + "2";
          return temp;
      })

    Duplicate issue

    Other references with high confidence

    Other references with low confidence

    None

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions