Community
Participate
Working Groups
On line 4, rename field 'x'. ------------------------ Bug.java -------------------- class Bug { { new Object(){ int x; // LINE 4 int foo(){return x;} }; new Object(){ int x; int foo(){return x;} }; } }
Reproduced in I20060628-1135 - Select 'x' on line 4 and use Refactor > Replace - Refactoring shoes error that 'x' is shadowed by an other declaration - Pressing 'OK' anyways' will alse rename 'x' in the second annonymous class. The bug seems to be with the search engine that also reports the 'x' in the second annonymous class as connected to the first 'x'
FieldPattern built on give IJavaElement does not include local type occurenceCount => each anonymous x field matches the pattern...
Looks like a pure theoretical uncommon test case. Even if it's a real case, there's a real simple workaround: just use a different name for the field in the second anonymous. No plan to fix this issue
Verified for 3.4M5.