Bug 271639

Summary: [extract local] can't extract temp from assignment inside another expression
Product: [Eclipse Project] JDT Reporter: Brian Miller <Brian.Miller>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Bug Depends on: 287701    
Bug Blocks:    

Description Brian Miller CLA 2009-04-08 10:39:45 EDT
Build ID: I20090313-0100   (3.5M6)

Please try to extract a local variable from the entire expression on LINE 5.  A popup dialog complains:  "An expression must be selected to activate this refactoring."

----------------- Bug.java -----------------
class Bug {
	{
		String[]both={"",""};
		System.out.print(
	both[hashCode()%2]=new String() //LINE 5
			);
	}
}
Comment 1 Markus Keller CLA 2009-08-26 10:56:35 EDT
Bug 287701 causes the "An expression must be selected" message.

Without whitespace after the assignment this has just not been implemented (but gives a proper error message). Simple example:

            int x;
            System.out.println(x=1);
Comment 2 Eclipse Genie CLA 2019-05-14 05:33:11 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.