Eclipse breakpoint in single / one line lambda?

How can I set a breakpoint in a single line lambda?

e.g. I’d like the (eclipse) debugger to halt, when outer.doSth(event) is called:

observable.addCallback(event-> outer.doSth(event));

Answer

You can’t.

If you refactor it like this:

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

you can.

Leave a Reply

Your email address will not be published. Required fields are marked *