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

Bug 311206

Summary: Adding InnerTeam for aspectBinding with the PDE Extension Editor results in wrong code
Product: [Tools] Objectteams Reporter: Jan Marc Hoffmann <exelnet>
Component: OTEquinoxAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: stephan.herrmann
Version: 1.4   
Target Milestone: 0.7 M2   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch none

Description Jan Marc Hoffmann CLA 2010-04-30 12:10:58 EDT
When adding an aspectBinding using the PDT Editor, the class property for inner Teams will get the wrong value.:

Added:
package.OuterTeam$InnerTeam

Should be:
package.OuterTeam$__OT__InnerTeam

Reproduction:
Open PDT Editor
Add aspectBinding
Browse InnerTeam
Comment 1 Stephan Herrmann CLA 2010-04-30 17:19:04 EDT
I just (bug 311109) added capability to OT/Equinox to correctly handle
the case where a team is specified as package.OuterTeam.InnerTeam.

I'm leaving this bug open for now to remind me that we need to settle
the issue of '.' vs. '$'. I wonder whether (where?) it is specified
how extension points should handle nested classes - by their source
name (using '.') or binary name (using '$').
Assuming that the name will be used for a call to loadClass() the
binary name is probably correct and OT/Equinox would still need
to learn translating Outer$Inner into Outer$__OT__Inner.
Comment 2 Stephan Herrmann CLA 2010-05-01 16:31:37 EDT
Created attachment 166721 [details]
patch

This patch adds heuristics that can find the correct binary name
from either a source name (using '$') or a binary name referring to
the interface part with a '$' separator. Either separators are replaced 
by "$__OT__" (recursively) to check whether a class of that name exists.
Names with more "$__OT__" are tried before others.

For source names only those names are considered as classes that start
with an upper case letter (according to code conventions), to avoid
gazillions of failing class lookups.
Comment 3 Stephan Herrmann CLA 2010-05-01 16:39:21 EDT
Patch (along with slight update to the extension point docu) is committed as r276.
Comment 4 Stephan Herrmann CLA 2010-05-07 05:14:44 EDT
Verified for M2 using I201005052210
Comment 5 Stephan Herrmann CLA 2013-07-27 08:42:27 EDT
For reference: in Luna the '.' notation for inner teams can no longer be supported,
a '$' will be mandatory, because we need to generate a dynamic import from the
team name, which is impossible, if it contains path segments that could either be
a package or an outer class.

See also bug 406518.