Community
Participate
Working Groups
How about generating a compiler warning/error (severity configurable through the Java compiler prefs page) when a data member in a base class is shadowed by a definition in a derived class?
- Should it also warn if temporary variables override a field? I guess so. - What about the option to show it in the Outline and Members view like we do for methods?
What are you calling a data member ? A field ?
Yes, by data member I mean a field.
> - What about the option to show it in the Outline and Members > view like we do for methods? If by that you mean a decoration on the data member's item in the outline/members view that identifies it as a data override, then yes, that would be useful.
*** Bug 25838 has been marked as a duplicate of this bug. ***
Nice to have, but post 2.1
Also local variable/parameter hiding field or locals should also be signaled.
*** Bug 35784 has been marked as a duplicate of this bug. ***
Added warning in compiler to diagnose field/local variable/argument hiding each other. May want to also do methods hiding an enclosing one ?
Fixed
Verified.