| Summary: | Inner class in child calling protected method in parent | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Alessandro Vernet <avernet> | ||||
| Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 3.0 | ||||||
| Target Milestone: | 3.0 M9 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 9517 [details]
Test classes
Which version of Eclipse are you using ? Cannot reproduce in latest 3.0. Actually, I was able to reproduce it. I had forgot to specify '-verify' on command line. Problem comes from the fact we did not perform emulation for static targets (fields or methods). Fixed, added regression test InnerEmulationTest#test115 Thanks for fixing this so quickly! Verified in 200405180816 |
Compile the 2 attached files in Eclipse, and run p2.test2 from the command line with the -Xfuture option. You will get this exception: Exception in thread "main" java.lang.IllegalAccessError: tried to access method p1.test1.doit()V from class p2.test2$1 at p2.test2$1.bar(test2.java:9) at p2.test2.foo(test2.java:11) at p2.test2.main(test2.java:17) Eclipse does not seem to generate an accessor from p2.test2 to p1.test1, like Sun's javac does. Note: I am using -Xfuture not because I want to be paranoid, but because I have this problem when this code runs inside a Web application. The VM for the app. server is not started with -Xfuture, so I just assume that the VM is more strict when the code is loaded through a class loader.