Here is a simple example of some code that compiles using Java 6, but does not compile in Java 7.
public class Test {
private final
§4.9 ... Then the intersection type has the same members as a class type (§8) with an empty body, direct superclass Ck and direct superinterfaces T1', ..., Tn', declared in the same package in which the intersection type appears.
From my understanding of that JLS part, your case with a type variable
creates the following intersection:
package ;
class I extends Test {}
Therefore when you access members of the type T
you actually access members of the intersection type I
. Since private members are never inherited by subtypes accessing such member fails with compile-error. On the other hand access to package-private (default) and protected members is allowed by the fact the intersection is
... declared in the same package in which the intersection type appears.