News for hackers. Stuff that matters.
Re:What's Stopping Me Using Java8 Lambdas – Try Debugging Them by flavor8 on Sunday January 18, 2015 @09:06AM (#8907534)
> This is just a visualization issue of the debugger you're using

No it's not - it's (apparently) a JDK issue. See the discussion in the Jetbrains bug report. BTW if Eclipse can do this, Jetbrains want to know.

Re:What's Stopping Me Using Java8 Lambdas – Try Debugging Them by the8472 on Sunday January 18, 2015 @09:10AM (#8907546)
Is this[1] not what you want? Modulo a better UI of course.

[1] http://i.imgur.com/bwWvk0I.png

Re:What's Stopping Me Using Java8 Lambdas – Try Debugging Them by flavor8 on Sunday January 18, 2015 @09:33AM (#8907600)
I'm not associated with them, but they asked me for an eclipse screenshot if I had one, when I reported this issue to them and suggested that they create a workaround in their UI. (FWIW it's an annoying issue, but not enough for _me_ to stop using lambdas.)

If you have time, could you make the lambda a multi line chunk of code, so that it's clear that the breakpoint is inside the lambda? I'll pass it on to them. Thanks!

Re:What's Stopping Me Using Java8 Lambdas – Try Debugging Them by the8472 on Sunday January 18, 2015 @09:47AM (#8907641)
Sure, here you go: http://i.imgur.com/posDGaB.png

Of course this only works for cases where the debugger can tie the lambda used as method argument to another stack frame, i.e. it doesn't help with async invocations. But in async cases one cannot expect the JVM to lug around the whole stack frame from the time it was created, that could lead to memory leaks.

And from what I've gathered the Jetbrains bug may not talking about the same thing as the blog postis discussing. Their case is about a captured variable that gets inlined in some way that makes debugging difficult, OP is about inspecting arbitrary, non-captured variables in the debugger.

Re:What's Stopping Me Using Java8 Lambdas – Try Debugging Them by iwince on Sunday January 18, 2015 @11:32AM (#8907886)
Where did "e" get declared at? It just seems to leap magically into existence.
Re:What's Stopping Me Using Java8 Lambdas – Try Debugging Them by the8472 on Sunday January 18, 2015 @11:52AM (#8907942)
List<T>#forEach takes a Consumer<? super T>

Consumer<U> has a single abstract method

void accept(U u)

The lambda effectively is an anonymous class implementing that interface / that single method. U resolves to ? super String. I.e. it expects a method that takes String or a superclass thereof as its first parameter.

That's what e is. It all gets automatically pieced together at compile time via type inference.