Community
Participate
Working Groups
An inner interface is implicitly static. It should not be allowed to reference an outer classes type variable. The reference to "T" in the inner interface below should be flagged as an error. class Outer<T> { interface Inner { abstract void m1(T t); } }
Created attachment 19818 [details] Proposed patch The proposed patch simply marks inner interfaces as static. See JLS2 8.5.2.
Created attachment 19823 [details] Proposed Test Case Added a test to GenericTypeTest
Thanks Tim.
Without any change, we already detect: public class X<T> { interface Y { java.util.List<T> lt; } } The suggested fix is adding a static modifier to member interfaces which I believe we would need to clear at some later point. Would prefer another approach.
Fixed by using isStatic() in place of bit check in Scope#getTypeOrPackage(...). Added GenericTypeTest#test713 Fixed
Verified in N20050606-0010 + JDT/Core HEAD
Verified with I20050610-010