Open gayanper opened 3 years ago
This make debugging lambda statement reliable in most of Java IDEs which will support full JDWP.
Note that this already works in IntelliJ IDEA. If looking for hints.
@shathor yes thats an IDE solution not supported by JDK tooling and IJ is not the only java IDE used in the industry. So i think adding support in JDK tooling will make IDE to focus more on user features.
Summary
Today there is no support for debugging lambda expressions using JDWP efficiently. The current support only capable of putting a line breakpoint where the jvm is suspended on each lambda expression in that line. But if the developer want to suspend only on certain lambda expression they have to make the lambda expression a lambda block which spans multiple lines.
Such example scenarios is debugging a stream operation such as
Stream.of(args).filer(s -> s.length() > 1).map(s -> s.trim()).collect(toList())
Some IDEs add method breakpoint after looking at synthetic methods that are generated for lambda expressions at compile time.Motivation
This enhancement will enable IDE developers to add breakpoints to lambda expressions without depending on how different compilers generate synthetic methods for lambda expressions. This make debugging lambda statement reliable in most of Java IDEs which will support full JDWP.