Eclipse breakpoint in single / single lambda line?

How to set breakpoint on single line lambda?

eg. I would like the debugger (eclipse) to stop when outer.doSth(event) is called:

 observable.addCallback(event-> outer.doSth(event)); 
+5
source share
2 answers

You can not.

If you reorganize it like this:

 observable.addCallback(event-> { return outer.doSth(event); }); 

You can.

+4
source

Well, this answer is not for eclipse, but in intellij you can (15.x)

enter image description here

You have the option to set a breakpoint either on the line (which is the first option on the image), or on the first lambda or on the second. And so on.

0
source

Source: https://habr.com/ru/post/1240915/


All Articles