[ https://issues.apache.org/jira/browse/NETBEANS-3580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053234#comment-17053234 ]
Netbeans User 2019 edited comment on NETBEANS-3580 at 3/6/20, 10:04 AM: ------------------------------------------------------------------------ I can see that in version 11.3 it is only way to stop in lambda: * go in up to apply "map/filter", but you end up in call of method inside of lambda (so one level deeper) * but if you try that above you got a lambda method name so you can use "Breakpoints" (Window->Debuging->Breakpoints) to create method break point on such name (use ESC on text field where you type such "lambda method name"). This helps to get on lambda entry. *In any case I would like to suggest to be lambda such "synthetic methods" in the list of method type break points so no need to really do step one.* was (Author: nb-user-2019): I can see that in version 11.3 it is only way to stop in lambda: * go in up to apply "map/filter", but you end up in call of method inside of lambda (so one level deeper) * but if you try that above you got a lambda method name so you can use "Breakpoints" (Window->Debuging->Breakpoints) to create method break point on such name (use ESC on text field where you type such "lambda method name"). This helps to get on lambda entry. In any case I would like to suggest to be lambda such "synthetic methods" in the list of so no need to really do step one. > 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, 11.3 > Reporter: Jan Lahoda > Assignee: Akshay Gupta > Priority: Critical > Labels: debug, lambda > > 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). > The IDE is a fully updated Apache NetBeans 11.2, with nb-javac installed > running on JDK 13: > Product Version: Apache NetBeans IDE 11.2 > Java: 13.0.1; OpenJDK 64-Bit Server VM 13.0.1+9 > Runtime: OpenJDK Runtime Environment 13.0.1+9 > System: Linux version 4.15.0-72-generic running on amd64; UTF-8; en_US (nb) > User directory: /tmp/nbuser.lambda.test > Cache directory: /tmp/nbuser.lambda.test/var/cache -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists