Community
Participate
Working Groups
The AdaptExpression assumes that if an element has an AdapterFactory for a target type, and the adapter returned is null, that the evaluation result is NOT_LOADED. However, there are cases where the adapter factory is loaded, but the element doeesn't have a valid adaption path. For instance, there is an adapter factory defined for IFile-->IJavaElement, but not all IFiles adapt to IJavaElement, only those which are part of the Java model. Therefore, the following expression: <adapt type="org.eclipse.jdt.coreIJavaElement" /> Should return EvalutationResult.FALSE when the JDT adapter factory is loaded, and a given IFile does not adapt to IJavaElement (like the '.project' file for instance).
Moving this to JDT-UI but that's not ideal either. Dirk, which component should we use for core.expressions?
The home is currently JDT/UI. Will look into it during M5.
The problem is that the adpat expression isn't able to figure this out without additional API on IAdapterManager. I propose an additional method queryAdapter(Object adaptable, String adapterTypeName) which returns either NONE, NOT_LOADED, LOADED. John, any comments ?
Can't you distinguish this case using IAdapterManager.hasAdapter? If hasAdapter returns true, then you know there is a factory that claims it can do the transformation. If a subsequent call to loadAdapter returns null, you know that the factory exists but it is not willing to provide an adapter in that case.
If I call loadAdapter then I will trigger plug-in loading which I try to avoid. Currently the expression language doesn't load any polug-ins. It returns NOT_LOADED instead.
Moving to M6. John, can you please respond to my last comment.
Well, it sounds like you need new API on IAdapterManager then. I suggest entering an enhancement against Equinox Bundles (I don't have commit rights to IAdapterManager since the move to Equinox). The short summary is that when hasAdapter returns true but getAdapter returns false, there are two possible reasons: - The factory is not yet loaded - The factory is loaded but cannot adapt that particular object.
Michael, how important is this for you. If very important can you please express this in bug 127623. I can't fix this without the additional API.
Postponing since bug 127623 didn't get fixed in core.
I think for this release we can get around this since NOT_LOADED == FALSE in most of our uses of the Core Expressions framework. One possible suggestion is that with the new API on EvaluationContext to load plugins when necessary to evaluate expressions could also indicate that it's okay to load plugins for Adapter Factories as well.
See bug 151239 for another case where an adapt expression should return FALSE instead of NOT_LOADED.
Moving bugs due to ownership change.
I'd like to consider this as an enhancement for 3.7. Adding the adapt element equivalent of test's forcePluginActivation attribute. PW
I'll have to move it off to 3.8/4.2 PW
Hi Paul, how's it looking for for delivery with 4.2?
this won't make it into 4.2 now. I've marked it as helpwanted. PW
(In reply to comment #16) > this won't make it into 4.2 now. I've marked it as helpwanted. > > PW Sorry, 4.3 is already closed for such a change.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.