Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 58606

Summary: Inner class in child calling protected method in parent
Product: [Eclipse Project] JDT Reporter: Alessandro Vernet <avernet>
Component: CoreAssignee: 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:
Description Flags
Test classes none

Description Alessandro Vernet CLA 2004-04-15 01:03:32 EDT
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.
Comment 1 Alessandro Vernet CLA 2004-04-15 01:04:08 EDT
Created attachment 9517 [details]
Test classes
Comment 2 Philipe Mulet CLA 2004-04-15 07:50:27 EDT
Which version of Eclipse are you using ? Cannot reproduce in latest 3.0.
Comment 3 Philipe Mulet CLA 2004-04-15 08:08:32 EDT
Actually, I was able to reproduce it. I had forgot to specify '-verify' on 
command line.
Comment 4 Philipe Mulet CLA 2004-04-15 09:29:59 EDT
Problem comes from the fact we did not perform emulation for static targets 
(fields or methods).

Fixed, added regression test InnerEmulationTest#test115
Comment 5 Alessandro Vernet CLA 2004-04-17 23:01:35 EDT
Thanks for fixing this so quickly!
Comment 6 Olivier Thomann CLA 2004-05-18 13:57:11 EDT
Verified in 200405180816