Bug 578715 - Line Breakpoint for statement spanning multiple lines toggles breakpoint on last line
Summary: Line Breakpoint for statement spanning multiple lines toggles breakpoint on l...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.23   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-13 05:09 EST by Sarika Sinha CLA
Modified: 2024-05-14 16:47 EDT (History)
4 users (show)

See Also:


Attachments
TestClassA (243 bytes, text/x-java)
2022-04-14 12:47 EDT, Shai Bentin CLA
no flags Details
The main test class (663 bytes, text/x-java)
2022-04-14 12:48 EDT, Shai Bentin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sarika Sinha CLA 2022-02-13 05:09:39 EST
Arrays //1
.asList("abc", "ab","c"). //2
.stream() //3
.forEach(System.out::println); //4


Arrays.asList("a", "b", "c").stream() //5
.filter(s -> s.length() > 0) //6
.filter(x -> x.charAt(0) > 1) //7
.filter(k -> k.indexOf(0) < 0) //8
.filter(p -> !p.isBlank()) //9
.forEach(System.out::println); //10

Toggling on line 1 and 5 toggles the breakpoint correctly.
Toggling on line 2,3 or 4 toggles the breakpoint at line 4 where as it should toggle at the selected line.
Toggling on line 6,7,,8,9 or 10 toggles the breakpoint at line 10 where as it should toggle at the selected line.
Comment 1 Shai Bentin CLA 2022-04-13 06:09:56 EDT
I don't know if this is related or not but I'm experiencing similar behaviour in an anonymous class:

columns.add(new DataColumn<SecuritiesRelease, SubSubject>(new StringResourceModel("subSubject", SecuritiesElasticAdminPanel.this), true, "subSubject") {
	private static final long serialVersionUID = 2685835547177682476L;
					
	@Override
	public Component wrap(SecuritiesRelease obj, int idx) {
	     if (null != obj) { // line 1. where I want the breakpoint
		if (null != obj.getSubSubject() && !obj.getSubSubject().isEmpty()) {
			StringJoiner joiner = new StringJoiner(",");
			...
			return new Label(WicketIdConstants.TMP, Model.of(joiner.toString()));
		}
	}
	return new Label(WicketIdConstants.TMP);
					}
}.setSize(7f)); // line 2. where I get the breakpoint

Toggling on line 1 where I want the breakpoint I get a breakpoint set at line 2. The process does not stop at all on line 2 either.

I've noticed something.

My code uses fluent api thus, at the last line (line 2) I have 'setSize(7f)'. If I remove that piece of code then toggling line 1 sets the breakpoint at line 1 where I want it, but when 'setSize(7f)' exists the breakpoint is set on line 2.

Since the fluent API is used tremendously in my code it practically makes eclipse unusable for me.

Version: 2022-03 (4.23.0)
Build id: 20220310-1457

openjdk version "11.0.14.1" 2022-02-08
OpenJDK Runtime Environment (build 11.0.14.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.14.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
Comment 2 Sarika Sinha CLA 2022-04-13 06:25:55 EDT
(In reply to Shai Bentin from comment #1)
> I don't know if this is related or not but I'm experiencing similar
> behaviour in an anonymous class:
> 
> columns.add(new DataColumn<SecuritiesRelease, SubSubject>(new
> StringResourceModel("subSubject", SecuritiesElasticAdminPanel.this), true,
> "subSubject") {
> 	private static final long serialVersionUID = 2685835547177682476L;
> 					
> 	@Override
> 	public Component wrap(SecuritiesRelease obj, int idx) {
> 	     if (null != obj) { // line 1. where I want the breakpoint
> 		if (null != obj.getSubSubject() && !obj.getSubSubject().isEmpty()) {
> 			StringJoiner joiner = new StringJoiner(",");
> 			...
> 			return new Label(WicketIdConstants.TMP, Model.of(joiner.toString()));
> 		}
> 	}
> 	return new Label(WicketIdConstants.TMP);
> 					}
> }.setSize(7f)); // line 2. where I get the breakpoint
> 
> Toggling on line 1 where I want the breakpoint I get a breakpoint set at
> line 2. The process does not stop at all on line 2 either.
> 
> I've noticed something.
> 
> My code uses fluent api thus, at the last line (line 2) I have
> 'setSize(7f)'. If I remove that piece of code then toggling line 1 sets the
> breakpoint at line 1 where I want it, but when 'setSize(7f)' exists the
> breakpoint is set on line 2.
> 
> Since the fluent API is used tremendously in my code it practically makes
> eclipse unusable for me.
> 
> Version: 2022-03 (4.23.0)
> Build id: 20220310-1457
> 
> openjdk version "11.0.14.1" 2022-02-08
> OpenJDK Runtime Environment (build 11.0.14.1+1-Ubuntu-0ubuntu1.20.04)
> OpenJDK 64-Bit Server VM (build 11.0.14.1+1-Ubuntu-0ubuntu1.20.04, mixed
> mode, sharing)

Can you provide a simple reproducible scenario?
Comment 3 Shai Bentin CLA 2022-04-14 12:47:38 EDT
Created attachment 288445 [details]
TestClassA
Comment 4 Shai Bentin CLA 2022-04-14 12:48:11 EDT
Created attachment 288446 [details]
The main test class
Comment 5 Shai Bentin CLA 2022-04-14 12:49:10 EDT
Attached are two files. Load them in latest eclipse and you should see the problem. In my eclipse it happens
Comment 6 Sarika Sinha CLA 2022-04-14 14:09:33 EDT
(In reply to Shai Bentin from comment #5)
> Attached are two files. Load them in latest eclipse and you should see the
> problem. In my eclipse it happens

Thank you for the snippet, I can reproduce.
Comment 7 Alessandro Nistico CLA 2022-05-22 23:40:52 EDT
Will this be fixed for the June release? It seems quite high prioruty to me.
Comment 8 Eclipse Genie CLA 2024-05-14 16:47:37 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.