| Summary: | alt+shift+L shows error if before .stream().map(...) exists | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Alexey Ulyanov <lexxsol> | ||||
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | lexxsol | ||||
| Version: | 4.7 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| 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 263607 [details] Screenshot of error described in Example 2 Checked in last Eclipse 4.7 and 4.4. Alt+Shift+L shortcut extracts local variable from selected piece of code. it is working fine even if current line is not ended with semicolon. Example 1: private void noErrorNoLambda(List<Container> list) { list.size() } You are able to extract list.size() piece of code to local variable here if you just select it and run Alt+Shift+L. Note that line is not ended with semicolon. But if .stream().map(...) is run before in scope of current method then extracting local variable shortcut is throwing error if current line is not ended with semicolon. Example 2: private void errorWithLambda(List<Container> list) { Stream<Long> map = list.stream().map(o->o.getId()); list.size() } You are not able to extract list.size() to local variable using Alt+Shift+L shortcut by selecting list.size() piece of code if line is not ended with semicolon (please check attached screenshot) But if you add semicolon at the end of list.size() and select it again and press Alt+Shift+L it will work as expected. I noticed that map() method executed in lambda expression is culprit