Bug 355315 - callout inferred to implement protected method causes IllegalAccessError
Summary: callout inferred to implement protected method causes IllegalAccessError
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 2.0   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard: To be verified for 2.1 M1
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-21 08:31 EDT by Stephan Herrmann CLA
Modified: 2011-08-25 05:27 EDT (History)
0 users

See Also:


Attachments
Test & fix (6.34 KB, patch)
2011-08-21 09:56 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-08-21 08:31:51 EDT
A role has a protected abstract method.

Its non-abstract subrole (in a sub-team if that matters) uses callout
inference to implement that abstract method.

The compiled program throws IllegalAccessError because clients may invoke 
the method via the role interface (public) but find a protected method.
Comment 1 Stephan Herrmann CLA 2011-08-21 09:56:44 EDT
Created attachment 201867 [details]
Test & fix

Patch contains a test and the simple fix:
In determining whether the generated role method needs modifier translation
we wrongly excluded all inferred callouts. 
Fixed by a new query InferenceKind.isAdvertisedInInterface().

The patch also contains a correction for the test case from bug 355314
(make class names unique).
Comment 2 Stephan Herrmann CLA 2011-08-21 09:58:08 EDT
Patch has been released for 2.1 M1
should also be backported to 2.0.1.
Comment 3 Stephan Herrmann CLA 2011-08-21 10:05:36 EDT
Released for 2.0.1
Comment 4 Stephan Herrmann CLA 2011-08-25 05:27:37 EDT
Verified for 2.0.1 RC2 using build 2.0.1.201108250423