Community
Participate
Working Groups
In the following case, the 'Outer' interface is used, but it is marked as "never used locally", and code assist suggests to be removed. Many thanks. Ahmed Ashour public class Test { private interface Outer { interface Inner { String variable = "my testing"; } } public static void main( String[] args ) { System.out.println(Outer.Inner.variable); } }
Reproduce with 3.2 build. It sounds that we need to recurse through member type hierarchy in method ASTNode.isTypeUseDeprecated(TypeBinding, Scope). Following test case with only one enclosing type level is correct: public class Test { private interface Outer { String variable = "my testing"; } public static void main(String[] args) { System.out.println(Outer.variable); } }
Rephrase my previous comment: It seems we need to recurse through all enclosing types while setting ExtraCompilerModifiers.AccLocallyUsed bit...
I think you are right.
Frederic - pls prepare the change and show it to me before releasing.
Created attachment 51670 [details] Proposed patch
Philippe, see TODO in the patch...
Comment on attachment 51670 [details] Proposed patch Patch is not smart enough in some corner cases as: public class Test { private class A { class B {} } private class X extends A { } X.B d = null; }
Other testcase: public class X { private class A { class B {} } private class Y<T> extends A { } Y<String>.B d = null; }
Problem occurs in different places. Added support for Qualified type ref, Param qualified type ref. Still need support for qualified name ref (as in original testcase). Added regression tests: GenericTypeTest#test1098 InnerEmulationTest#test135
Also added InnerEmulationTest#test136-139
Released for 3.3M5. Fixed
Verified for 3.3 M5 using build I20070206-0010