But - I'm still hesitant to use Java8 lambdas because it's so difficult to debug them! See the screenshot below, which is currently at the breakpoint on line 18:
Notice how you only have visibility of the variables inside the lambda. It is not even possible to see view the contents of the List 'letters' around which you are iterating.
Clearly in this contrived example it makes little difference but when you are debugging a complex system this becomes a serious pain in the neck. Time and again I've found myself replacing lambda constructs for the old style loops so that I can see what's going on in variables outside the scope of the lambda.
I'm not sure if this problem is confined to IntelliJ or whether it exists in Eclipse, Netbeans etc [EDIT from the response from IntelliJ it seems to be a Java issue not an IntelliJ one] but IntelliJ is so great and I'm certainly not moving away from it in the near future.
I've raised this with the guys at IntelliJ and they have promised that someone will be looking into this problem. I'll be updating this post with any progress.
[EDIT] UPDATE FROM INTELLIJ
The issue is known: https://youtrack.
You are welcome vote for it or star it to receive notifications about the future changes.
Unfortunately, it is not something we can do on our own, we’re waiting for JDK to support lambdas in the debugger.
Here’s the corresponding request in JDK tracker: https://bugs.openjdk.