Bug 58606 - Inner class in child calling protected method in parent
Summary: Inner class in child calling protected method in parent
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-15 01:03 EDT by Alessandro Vernet CLA
Modified: 2004-05-18 13:57 EDT (History)
0 users

See Also:


Attachments
Test classes (605 bytes, application/zip)
2004-04-15 01:04 EDT, Alessandro Vernet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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