Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369294 - [rename] Renaming a field of an anonymous class
Summary: [rename] Renaming a field of an anonymous class
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-20 15:59 EST by Milos Gligoric CLA
Modified: 2018-11-14 19:03 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Gligoric CLA 2012-01-20 15:59:58 EST
Build Identifier: Version: 3.7.1 Build id: I20110613-1736

Renaming a field of an anonymous class renames a field of inner class that has the same name.

Reproducible: Always

Steps to Reproduce:
1. Rename "foo" field in anonymous class in the example below.  Refactoring would try to rename a referece to "foo" field in the "Inner" class.

class Top {

    class Inner {
        int foo;

        void innerMethod() {
            if (foo > 0) { // THIS WILL BE RENAMED TOO
            }
        }
    }

    Object topMethod() {
        return new Object() {
            int foo; // RENAME THIS FIELD

            void anonymousMethod() {
                if (foo > 0) {
                }
            }
        };
    }
}
Comment 1 Mohsen Vakilian CLA 2012-01-21 08:00:11 EST
This bug might be related to Bug 213144.
Comment 2 Dani Megert CLA 2012-02-21 08:09:28 EST
Can reproduce using 3.8 M5.

Similar to bug 213144.
Comment 3 Eclipse Genie CLA 2018-11-14 19:03:15 EST
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.