Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Where did "e" get declared at? It just seems to leap magically into existence.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: