Community
Participate
Working Groups
Using HEAD, compile this code with -warn:hiding,unused. You'll get two field hiding warnings. Removing the imports fixes it and doesn't report any error. So the two imports are unused and should be reported as is. package sample; import static sample.Test.TestEnum.V1; import static sample.Test.TestEnum.V2; public class Test<T> { public static enum TestEnum { V1, V2 } public void test(final TestEnum value) { switch (value) { case V1: case V2: } } }
Hiding check shouldn't mark import as used, since these are not truly referenced (only a side effect of the hiding check).
Tuned StaticImportTest#test047-048 + added test049.
Created attachment 54168 [details] Proposed patch
Released for 3.3M4 Fixed
Verified for 3.3M4 with I20061211-1119