Duplicate :
|
FULL PRODUCT VERSION : $ java -version java version "1.7.0-ea" Java(TM) SE Runtime Environment (build 1.7.0-ea-b119) Java HotSpot(TM) 64-Bit Server VM (build 20.0-b03, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.1.7600] A DESCRIPTION OF THE PROBLEM : The attached source code fails to compile STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Compile said class fails EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - It should compile correctly ERROR MESSAGES/STACK TRACES THAT OCCUR : Wtf.java:[7,28] foo has private access in Wtf REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public class Wtf { private Object foo; public <T extends Wtf> void test(T t) { System.out.println(t.foo); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : make the field package private