Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » PlatformObject.getAdapter(Class) returns null during start-up
PlatformObject.getAdapter(Class) returns null during start-up [message #1059104] Thu, 16 May 2013 17:36 Go to next message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 132
Registered: July 2009
Senior Member
We (Dali) adapt the platform interface IProject to the Dali interface ProjectResourceLocator.

This Dali interface and its sole implementation, SimpleProjectResourceLocator, are in the plug-in o.e.jpt.common.core. The IAdapterFactory that implements this "adaptation" is in the same plug-in. And plugin.xml defining the corresponding extension to the o.e.core.runtime.adapters extension point is also in the same plug-in.

The problem: Intermittently, during start-up, a call to IProject.getAdapter(ProjectResourceLocator.class) will return null with the first call but not null with subsequent calls. The adapter factory is implemented in such a way that it will never return null; so, apparently, the adapter factory is not invoked by the platform adapter manager. This seems to be a bug, as the plug-in must have been loaded for the class ProjectResourceLocator to be resolved. Unfortunately, in a test workspace where this happens with every start-up, it never happens when executing under the debugger (even with no breakpoints whatsoever).

Is this expected behavior (i.e. that even though a plug-in is loaded, its adapter factories are not necessarily loaded)? If not, can anyone offer any hints as to how we can investigate, sans the debugger, why the platform adapter manager does not invoke the appropriate adapter factory?
Re: PlatformObject.getAdapter(Class) returns null during start-up [message #1061032 is a reply to message #1059104] Wed, 29 May 2013 15:25 Go to previous message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 132
Registered: July 2009
Senior Member
For the record: This is a bug with the Eclipse platform, and we have submitted a patch.[1]

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=408506
Previous Topic:ComboViewer catching "drop down" event
Next Topic:BadLocationException when hovering
Goto Forum:
  


Current Time: Sun Nov 23 17:36:52 GMT 2014

Powered by FUDForum. Page generated in 0.09446 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software