Bug 472845 - [1.8][inline] Refactor static inline method doesn't check for method references
Summary: [1.8][inline] Refactor static inline method doesn't check for method references
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-16 10:44 EDT by Alex Blewitt CLA
Modified: 2024-03-20 16:33 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2015-07-16 10:44:01 EDT
I had a static method and a method literal to that method in a separate method:

class Example {
  void user(Stream<String> s) {
    s.map(Example::uppercase).forEach(System.out::println);
  }
  private static String uppercase(String s) {
    return s.toUpperCase();
  }
}

When I did Refactor - Inline method on uppercase the change just deleted the uppercase method and left Example::uppercase as a code error.

I was expecting it to inline the method reference as a lambda, eg

  s.map(s -> s.toUpperCase())

(This could then be optimised further in this case to String::toUpperCase but I wouldn't have expected that to happen in this case)

This is on Eclipse 4.5.0.
Comment 1 Eclipse Genie CLA 2020-04-27 12:56:10 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.
Comment 2 T. Orf CLA 2020-05-01 10:41:24 EDT
Still the same in Version: 2019-12 (4.14.0) Build id: 20191212-1212.
This is still relevant; refactoring compiler-clean code should not lead to compiler errors.

Please reopen (which I apparently cannot do). Thanks!
Comment 3 Alex Blewitt CLA 2020-05-02 18:28:35 EDT
Reopening as per comment above.
Comment 4 Filippo Rossoni CLA 2022-03-30 19:10:40 EDT
Still the same in Version: 2022-03
Comment 5 Eclipse Genie CLA 2024-03-20 16:33:37 EDT
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.