Community
Participate
Working Groups
Take the following example package workbench; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class LambdaTest { Handler handler = new Handler(); public static void main(String[] args) { (new LambdaTest()).run(); } private ActionListener objectSetHandler = event -> { if (event.getID() > 0) { LambdaTest.this.handler.equals(""); System.out.println(event); } }; public void run() { objectSetHandler.actionPerformed(new ActionEvent(new Object(), 1, "")); } } It is unable to inspect "LambdaTest.this.handler" inside the objectSetHandler lambda instance.
The variable is shown as arg$1 inside the lambda object in variables view.
Is this bug 562056 comment 63? Do you see errors in the log?
No this basically get skipped because there are not synthetic local variables which i'm not pretty sure that it is. Not a expert on the JDT still.
I found this while i was trying to reproduce bug 562056 comment 63. But i couldn't reproduce that with my simple code.
(In reply to Andrey Loskutov from comment #2) > Is this bug 562056 comment 63? Do you see errors in the log? Yes, it is the "missing" test for that bug and basically the example from Simeon. Yes, there are errors in the log, and inspection doesn't work. Yes, the fix for bug 562056 fixes errors on inspection here. No, implicit object instance of the enclosing class is not properly resolved to a variable name because there is no variable defined for that implicit reference. We may try to add something like "val.LambdaTest.this" or even skip the "val". Reduced example: package x; public class LambdaTest { Object handler = new Object(); public static void main(String[] args) { (new LambdaTest()).run(); } private Runnable objectSetHandler = () -> { String string = handler.toString(); // breakpoint here, inspect handler.toString() System.out.println(string); }; public void run() { objectSetHandler.run(); } } 2 Errors: Compile error during code evaluation: Syntax error on token "}", delete this token Compile error during code evaluation: Syntax error on token "1", invalid VariableDeclaratorId @Simeon: thanks for this example, I will add it to the test for bug 562056.
@Andrey can we fix this issue ? Does your fix on xtext issue handle this as well ?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.