Community
Participate
Working Groups
The java language allows both the parent class and the child class to have a member variable with the same name. The field of the child class hides the field of the parent class. If the field in the parent class is not private, the programmer may introduce bugs by referring to the wrong field. I suggest to detect such situation and warn the user. Genady
*** This bug has been marked as a duplicate of 21140 ***
Ok - apparently shadowing and hiding are two different things (see par 6.3.1 of the JLS). Can you change the summary of bug #21140 to "Warning/error on hiding/shadowing definition of data member?"