Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325029 - [model] team-and-rolefile causes JavaModelException when accessed as member of its enclosing team
Summary: [model] team-and-rolefile causes JavaModelException when accessed as member o...
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.7.1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-11 08:51 EDT by Stephan Herrmann CLA
Modified: 2010-09-23 17:29 EDT (History)
0 users

See Also:


Attachments
implementation incl tests (11.54 KB, patch)
2010-09-11 14:26 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 2010-09-11 08:51:01 EDT
The type CreateMethodMappingCompletionProposal is now a team sitting
in a role file, which causes grief in the java model.

Especially if that inner team has nested roles we see lots of 
JavaModelExceptions (does not exist). Can be triggered from
HierarchyResolver.rememberWithMemberTypes().

The issue is that the SourceTypes used are children of the enclosing
team, while physically they should be seen as children of the role file.
Comment 1 Stephan Herrmann CLA 2010-09-11 14:26:47 EDT
Created attachment 178684 [details]
implementation incl tests

This patch hooks into JavaElement.getElementInfo(monitor) in order
to map elements representing a role file (or a nested role within a
role file).

* search (using search engine) ROFI via the enclosing team, do this
  recursively for all enclosing nested teams

* be careful that exists() on a ROFI IType answers true only if it is the
  canonical representation 
  (i.e.,, contained in the ROFI CompilationUnit not in the team)

* OTType.getRoleType() no longer directly searches role files, but relies
  on getElementInfo() doing this, we only ensure that the original handle
  (stored in the element info) is used.

Includes a new test under AllExternalUnboundRoleTests.
Comment 2 Stephan Herrmann CLA 2010-09-11 19:53:55 EDT
Patch has been committed as r784, r785

After the tests have been fundamentally repaired in r786-r788
they indicate that the fix works OK.
Comment 3 Stephan Herrmann CLA 2010-09-23 17:29:06 EDT
Verified using I201009211735