Community
Participate
Working Groups
Build Identifier: 20100218-1602 The warning "Field declaration hides another field or variable" does not warn if the affected classes are in different packages (example see below). If the affected classes are in the same package, it works fine! Reproducible: Always Steps to Reproduce: 1. Create classes package package1; public abstract class A { protected int field; } ------------------------ package package2; import package1.A; public abstract class B extends A { protected int field; } 2. Enable warning "Field declaration hides another field or variable" 3. It won't warn!
Reproduced in HEAD. Also works fine when I make A#field public.
I'll take a look.
Created attachment 172987 [details] Patch under consideration
Created attachment 172990 [details] Revised patch Earlier patch did not handle hiding a field from more than one level higher superclass.
Created attachment 172992 [details] Revised patch with remastered tests.
Satyam, please review -- Thanks.
(In reply to comment #6) Srikanth, the changes look good to me. +1
Released in HEAD for 3.7 M1.
Verified for 3.7M1 using build I20100802-1800.