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

Bug 366573

Summary: AdaptExpression doen't check for IAdaptable-Interface
Product: [Eclipse Project] Platform Reporter: Heiko Böttger <heiko.boettger>
Component: RuntimeAssignee: platform-runtime-inbox <platform-runtime-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

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 ***