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

Bug 368280

Summary: Diagnosing ambiguous references
Product: [Modeling] TMF Reporter: Ed Willink <ed>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: floplateau
Version: 2.2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2012-01-10 12:28:15 EST
The invocation of getLinkingService().getLinkedObjects within LazyLinkingResource.getEObject() does not appear to support ambiguities completely.

getEObject() may return a list of ambiguous alternatives but the subsequent testing then throws an untidy IllegalStateException, when it would be much more user friendly to return some form of "Ambiguous reference" diagnostic.

Is there a way to workaround this limitation other than my current approach just returns an empty list and so reports an "Unresolved ..." whenever the true problem is "Multiply resolved ...."
Comment 1 Ed Willink CLA 2012-06-18 16:56:03 EDT
Workaround:

Attach the multiple ambiguities as an adapter on the context object.
Return an empty list from getLinkedObjects.
Detect the adapter in an UnresolvedProxyMessageProvider.