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

Bug 352914

Summary: Avoid unnecessary decapsulation accessors for callout to field
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: Other   
OS: Linux   
Whiteboard: Also released in 2.1 M1
Attachments:
Description Flags
partial implementation
none
additional fix
none
additional fix with test (3) none

Description Stephan Herrmann CLA 2011-07-22 17:05:16 EDT
This came up during work on otredyn:

Callout-to-field is currently implemented with the indirection
of a wrapper method in the base class (generated by the otre) 
whose purpose is to realize decapsulation.

If the field is normally visible to the role class this wrapper is not
needed and should thus be avoided.
Comment 1 Stephan Herrmann CLA 2011-07-22 17:24:53 EDT
Created attachment 200226 [details]
partial implementation

This patch implements the requested optimization for "get" c-t-f.

The change spreads out because several locations assumed that a base method
always exists for all method bindings, which is no longer true.

One test case now reports a more precise error (check was buggy).

TODO: include "set" c-t-f in the optimization.
Comment 2 Stephan Herrmann CLA 2011-07-22 18:53:38 EDT
Created attachment 200230 [details]
additional fix

Fixing previous patch for static base fields (was: build failure).
Comment 3 Stephan Herrmann CLA 2011-07-23 06:51:46 EDT
Created attachment 200233 [details]
additional fix with test (3)

Fixing previous patch for invisible base class (was: build failure).
Comment 4 Stephan Herrmann CLA 2011-08-02 05:38:58 EDT
All tests pass with the three patches applied.
Comment 5 Stephan Herrmann CLA 2011-08-17 12:23:59 EDT
Verified for 2.0.1 using build 201108160141.