Summary: | [compiler] Private inner interface is "never used locally" | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Ahmed Ashour <asashour> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | philippe_mulet | ||||
Version: | 3.2 | ||||||
Target Milestone: | 3.3 M5 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Ahmed Ashour
2006-08-07 07:52:26 EDT
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 |