Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 481226

Summary: [1.8][extract method] Extract Method fails to include Instance from instance::method
Product: [Eclipse Project] JDT Reporter: Sebastian Schulthess <s.schulthess>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: noopur_gupta
Version: 4.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Sebastian Schulthess CLA 2015-11-02 05:37:24 EST
How to reproduce with Java 8:

Exctract Method containing code of a instance::method call.
The instance is not included in the arguments of the new extracted method.

Example:

// some other code
someList.forEach(aLogger::logScriptRow);

--> extraced method:
private void preReturnOperations() {
// some other code
someList.forEach(aLogger::logScriptRow);
    }

Here aLooger is missing.
Comment 1 Noopur Gupta CLA 2015-11-03 10:44:36 EST
Snippet to reproduce the bug:

package snippet;

import java.util.function.Supplier;

public class Snippet {
	void m1() {
		Snippet snippet = new Snippet();
		Supplier<String> s = snippet::test; // extract to method
	}

	private String test() {
		return null;
	}
}
Comment 2 Eclipse Genie CLA 2019-10-24 15:52: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.

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.