Bug 355315

Summary: callout inferred to implement protected method causes IllegalAccessError
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: Other   
OS: Linux   
Whiteboard: To be verified for 2.1 M1
Attachments:
Description Flags
Test & fix none

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