| Summary: | [1.8] Convert to lambda expression quick assist does unnecessary renames | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Marc-André Laperle <malaperle> | ||||
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | julian.honnen, matthew.khouzam, noopur_gupta | ||||
| Version: | 4.6 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
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. |
Created attachment 260906 [details] Sample project Using Eclipse 4.6-I20160412-0800 When trying to convert an anonymous class to a lambda expression, a quick assist is offered. If the body of the expression contains two variables with the same name but in different scopes, they get unnecessarily renamed. I attached a sample project to show this behavior: public class Main { public static void main(String[] args, Set<String> set) { new Thread(new Runnable() { @Override public void run() { int i = 0; if (i == 0) { int foo = 0; System.out.println(foo); } else { int foo = 1; System.out.println(foo); } } }); } } 1. Import the project 2. Place the cursor on 'new Runnable' 3. Press Ctrl+1 to invoke quick assist 4. Press the down arrow key to select "Convert to lambda expression" 5. Press Enter. The two 'foo' variables are renamed foo1 and foo2. This should not be necessary.