Wednesday 15 April 2015

intellij idea - Debugger cannot see local variable in a Lambda -



intellij idea - Debugger cannot see local variable in a Lambda -

i noticed when hover mouse on local variable when debugger stopped within lambda study cannot find local variable 'variable_name' if it's visible within lambda , it's used.

example code

public class main { public static void main(string[] args) { string = "hello_world"; m1(a); } private static void m1(string a) { accesscontroller.doprivileged((privilegedaction<string>) () -> { system.out.println("blala " + a); homecoming "abc"; }); } }

try breakpoint in system.out.println("blala " + a); , after return "abc" , study same error.

i used accesscontroller.doprivileged because it's used in original code , of course of study i'm using java 8.

it says same thing in watchers , evaluate expression.

i tried using "anonymous class" version , debugger sees value of a correctly

private static void m1(string a) { accesscontroller.doprivileged(new privilegedaction<string>() { @override public string run() { system.out.println("blala " + a); homecoming "abc"; } }); }

i'm missing lambda expressions or it's intellij thought 14 bug?

i don't want study bug right because reported bug caused code instead of intellij idea, want sure before (and because don't utilize java 8 often, wrong).

this appears know issue. according jetbrains root causes of behavior jdk. more info see: idea-126257

intellij-idea intellij-14

No comments:

Post a Comment