Community
Participate
Working Groups
The Sun javac accepts this; Eclipse does not. class A<T> { class B { } static { new A<String>().new B() {}; } } The complation fails with the message "No enclosing instance of type A<T> is accessible. Must qualify the allocation with an enclosing instance of type A<T> (e.g. x.new A() where x is an instance of A<T>)."
Bug exists on 3.1.0, problem only arises in presence of anonymous type with such qualification.
Fix released in 3.1 maintenance and 3.2 stream. Added GenericTypeTest#test793-795
Tests are actually GenericTypeTest#test795-797
Verified for 3.2M1 (I20050808-2000)
Verified for 3.1.1 using M20050923-1430.