Community
Participate
Working Groups
I20061010-0800 Given: package a.b; public class Foo { public void foo() { Object obj= new Object() { public String toString() { return "foo." + getName(); } }; String s= "foo." + getName(); } private String getName() {return "bar";} } 1. Select _second_ expression "foo." + getName() 2. Refactor>Extract Method... 3. extract method 'qualifiedName' Is: both expressions "foo." + getName() are replaced by a call to qualifiedName, correct. 4. Undo 5. Select first expression "foo." + getName() 6. Refactor>Extract Method... 7. Select 'Foo' as destination type 8. extract method 'qualifiedName' Is: Only first expression is replaced by call Should: Both expression should be replaced, at least I can't see no difference...
Created attachment 140552 [details] patch Suggested patch
Thanks, released to head (updated copyright date and put copyright entry on one line).
Verified for 3.6 M1 using I20090803-1800
The fix for this bug causes a collateral damage: in case of extracting into the anonymous class it enables the checkbox for other occurrences (see bug 285569).