IG visibility isssue

For 'off-line' inspections, under Visibility issues, I have

Local variable hides member variable.

I have also checked the Options "Ignore superclass fields not visible from

I have a class derived from JPanel which has overrides the following method:

public void setEnabled(final boolean enabled)

The inspection tells me that 'enabled' hides member variable.

I don't think that this is correct. Is it?


Ted Hill


java.awt.Component defines a package-visible boolean member variable enabled, so this is correct. This variable is likely inaccessible to your code (I'm assuming your code doesn't live in the java.awt package), but is potentially confusing nonetheless, so IG flags it as a warning.


But the inspection can be configured to

"Ignore superclass fields not visible from

The 'enabled' field in the parent class is not visible in my class.

So my thinking is, the inspection shouldn't tell me about this.

Ted Hill


Please sign in to leave a comment.