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

Bug 44419

Summary: inline method: arguments need to be parentized [refactoring]
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: UIAssignee: Dirk Baeumer <dirk_baeumer>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P2 CC: ribs
Version: 3.0   
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Martin Aeschlimann CLA 2003-10-08 08:33:58 EDT
20031008
	protected long fValue1= getValue(1 + 3);
	
	private long getValue(int i) {
		return System.currentTimeMillis() * i;
	}
results in:

        protected long fValue1= System.currentTimeMillis() * 1 + 3;
Comment 1 David Mandelin CLA 2005-04-05 19:21:49 EDT
The method body also needs to be parenthesized. The refactoring didn't work for
me on this example:

    if (!isString(s)) ...
    
    boolean isString(Object o) {
        return o instanceof String;
    }

I got

    if (!s instanceof String) ...

which is even a type error.
Comment 2 Dirk Baeumer CLA 2006-04-07 05:14:11 EDT
Fixed for RC1.

The problematic thing with this bug was that it introduced a semantic shift hard to spot.
Comment 3 Dirk Baeumer CLA 2006-04-07 05:16:50 EDT
Setting to fixed
Comment 4 Markus Keller CLA 2006-04-07 13:46:28 EDT
*** Bug 135115 has been marked as a duplicate of this bug. ***
Comment 5 Johannes Rieken CLA 2006-04-27 04:28:44 EDT
verified for 20060426