-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
7
-
x86
-
linux, linux_ubuntu, windows_xp
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b130)
Java HotSpot(TM) Server VM (build 21.0-b02, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Existing code compiles fine in Java 6, doesn't compile in Java 7
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Try to compile the attached code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The code should compile correctly
ACTUAL -
The code doesn't compile
ERROR MESSAGES/STACK TRACES THAT OCCUR :
privateMethod() has private access in JavacBug
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package bugs;
public class JavacBug
{
public static <T extends JavacBug> void doIt (T t)
{
t.privateMethod ();
}
private void privateMethod () {}
}
---------- END SOURCE ----------
- duplicates
-
JDK-7072895 Generic inner class cannot access outer class members
-
- Closed
-
-
JDK-8010429 Private field access via generic type - won't compile in 1.7; did in 1.6.
-
- Closed
-
-
JDK-8013845 Private field invisible in generics
-
- Closed
-
-
JDK-7029650 Existing private variable access now causes compiler error with JDK 7.
-
- Closed
-
-
JDK-7031023 Cannot access private field through generic reference in 1.7
-
- Closed
-
-
JDK-7108257 javac reports error that field is private and cannot be accessed
-
- Closed
-
- relates to
-
JDK-8131042 Private field access: invalid compiler error
-
- Closed
-