Bug 578996 - Breakpoints cannot be place in nested lambdas
Summary: Breakpoints cannot be place in nested lambdas
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.23   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.23 RC2   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: 486264
  Show dependency tree
 
Reported: 2022-02-27 03:40 EST by Hannes Wellmann CLA
Modified: 2022-03-01 20:30 EST (History)
3 users (show)

See Also:
kalyan_prasad: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Wellmann CLA 2022-02-27 03:40:25 EST
It is possible to place a break-point in a lambda expression block like the "s1" lambda in the following example.
But unfortunately it is not possible to place a breakpoint in a lambdas block if that lambda is nested in the other lambda like the "s2" or "s3" expressions below

Supplier<String> s1= () -> {
	return "";
};
Supplier<Supplier<String>> s2= () -> () -> {
	return "";
};
Supplier<Supplier<Supplier<String>>> s3= () -> () -> () -> {
	return "";
};


When I try to place a break-points in the line of the return statements of s2 or s3 the break-point is added to the method below instead. When both lambdas are converted to anonymous classes placing a break-point at the nested return works, but only if both Suppliers are classes, if only the inner one is a class creation it still does not work.

My Eclipse version is 2022-03 M3 (4.23.0 M3), Build id: 20220224-1226 and I did not encounter this behaviour before so it could be a regression. I hope I have assigned the right Bugzilla Components.
Comment 1 Sarika Sinha CLA 2022-02-28 00:45:12 EST
Yes, this is a regression from Bug 486264.
Thanks for testing and reporting.

Just as a workaround, till we fix this bug, you can add a Lambda entry breakpoint at s2 or s3 from Context menu of Ruler or Run Menu option.
Comment 2 Eclipse Genie CLA 2022-02-28 02:29:06 EST
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/191250
Comment 3 Hannes Wellmann CLA 2022-02-28 05:22:07 EST
Thank you for taking care of this.
Comment 5 Sarika Sinha CLA 2022-03-01 20:30:25 EST
Build id: I20220301-0600