Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366573 - AdaptExpression doen't check for IAdaptable-Interface
Summary: AdaptExpression doen't check for IAdaptable-Interface
Status: CLOSED DUPLICATE of bug 201743
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 11:17 EST by Heiko Böttger CLA
Modified: 2011-12-19 09:06 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Böttger CLA 2011-12-13 11:17:42 EST
Build Identifier: 20110916-0149

The AdaptExpression#evaluate method only checks if there is an adapter provided by the AdapterFactory. An object implementing the IAdaptable-Interface may return additional adapters not available through the AdapterManager.

Examples are the FileStoreEditorInput or WorkbenchPart-Subclasses.

This was a major problem when implementing our Common Navigator Framework ContentProvider, where contribution didn't appear. 

Workaround: 
Never define an Adapter inside an IAdaptable, always delegate to the Platform AdapterManager as implemented in PlatformObject and register a AdapterFactory via ExtensionPoint.


 

Reproducible: Always

Steps to Reproduce:
1. Create a Class implementing IAdaptable and returning an adapter
2. Invoke a AdaptExpression tesing for the adapter on a selection containing the adaptable
Comment 1 Paul Webster CLA 2011-12-13 12:48:49 EST

*** This bug has been marked as a duplicate of bug 201743 ***