Bug 35784 - detect hiding (non-private) fields
Summary: detect hiding (non-private) fields
Status: RESOLVED DUPLICATE of bug 21140
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-27 15:53 EST by Genady Beryozkin CLA
Modified: 2003-06-02 06:13 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Genady Beryozkin CLA 2003-03-27 15:53:59 EST
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
Comment 1 Philipe Mulet CLA 2003-03-28 04:37:35 EST

*** This bug has been marked as a duplicate of 21140 ***
Comment 2 Genady Beryozkin CLA 2003-03-28 04:59:28 EST
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?"