You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Jan Lahoda (Jira)" <ji...@apache.org> on 2019/12/11 07:33:00 UTC

[jira] [Created] (NETBEANS-3580) Expression Lambdas cannot be debugged

Jan Lahoda created NETBEANS-3580:
------------------------------------

             Summary: Expression Lambdas cannot be debugged
                 Key: NETBEANS-3580
                 URL: https://issues.apache.org/jira/browse/NETBEANS-3580
             Project: NetBeans
          Issue Type: Bug
          Components: debugger - Java
    Affects Versions: 11.2
            Reporter: Jan Lahoda


Consider this source code:

{{package org.netbeans.modules.learning.lambda.code.completion;}}

{{import java.util.Arrays;}}

{{public class NewClass {}}

{{    public static void main(String... args) {}}
{{        Arrays.stream(new String[] \{"a", "", "b"})}}
{{              .filter(s -> !s.isEmpty()) //breakpoint here}}
{{              .forEach(System.err::println);}}
{{    }}}
{{}}}

 

Add a breakpoint at the marked line, and run the code under the debugger. The debugger will stop on the breakpoint for the "filter" method invocation (OK), but it will not stop there for the lambda invocation (bad). So with a code like this, one does not see the lambda parameters, cannot step inside, etc. Workaround is to place the expression on a new line:

{{ .filter(s -> }}
{{ !s.isEmpty()) //breakpoint here}}

But that requires a change to the code just for debugging - and that defies the purpose of debugging (which is to inspect the code *without* changes).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists