This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version: NetBeans IDE Dev (Build 201408170001) Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12 System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev 1. Open the testcase project. 2. Set a breakpoint in Main.java lines 6 and 7 3. Start a debugging session. 4. Bug #1: "variable" is defined on line 6 but not on line 7. 5. Bug #2: When line 7 is hit, the Debugging tab contains an erroneous line between Main.lambda$run$0:7 and Main.translateRequest:13 (in my case, it's called 155584260.process)
Created attachment 148748 [details] Testcase
I consider this a very serious regression, so please test it against the 8.0.1 branch (which I don't have access to). If the bug is present there, I would urge you to delay the release until it is fixed.
Reproduced. I do not think this is a regression, since the same behavior is in 8.0. Bug #2 - this is not an errorneous line, but it should be "Main$$Lambda$1.242481580.process" It's a stack frame, therefore it should be there. It looks like only this frame contains the value of "variable" under this.arg$1
Interesting, I thought I saw this working before but I guess not. Okay, so next question: will a fix make it into 8.0.1? I'm guessing not.
Unfortunately not. The 8.0.1 release will be soon and we even do not know how to best fix this. I've verified that this does not work even with jdb: main[1] print variable com.sun.tools.example.debug.expr.ParseException: Name unknown: variable
So it's possible this is actually a JDK bug?
We need to analyze it more to see how outer variables are handled in lambdas.
https://bugs.openjdk.java.net/browse/JDK-8058227
The JDK bug 8058227 was fixed in JDK 9. Thus it will be fixed in the next NetBeans version, which will be adapted for JDK 9.
This was also backported to JDK8 update 60. As such, please consider a fix for an earlier release than JDK9.
Reopening because this was fixed in JDK8 update 60, yet I still can't debug the variables in that version (using Netbeans dev build 201506240001). I suspect that Netbeans needs to be fixed as well.
To clarify, I am running JDK8 update 60 build 21 which I downloaded from https://jdk8.java.net/download.html
You need to recompile the code. :-(
Have just tried it with: Product Version: NetBeans IDE Dev (Build 201508100002) Java: 1.8.0_60-ea; Java HotSpot(TM) 64-Bit Server VM 25.60-b23 Runtime: Java(TM) SE Runtime Environment 1.8.0_60-ea-b25 with jdk 8u60b25 from https://jdk8.java.net/download.html, rebuilt everything. Still no luck, variable is available only on line 6, not 7. Was the fix really pushed into 8u60?