views:

180

answers:

1

Hello, I vahe eclipse rcp app. In my plugin A I use 3rd party plugin B. In plugin B there is plugin.xml with some extensions. In my plugin A I have added some extensions to extensions defined in plugin B, and it works.

Now I tried to overwrite some values in some extensions from B in plugin A. Now, when I run app sometimes it uses old values (from plugin.xml in plugin B), sometimes it uses my new values (from plugin A plugin.xml). It's consistent in one execution of app, but changes from execution to execution.

Code that gets these values is in plugin B and I wouldn't like to change it. And looks like that:

IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint("org.jbpm.gd.common.xmlMappings");
IExtension[] extensions = extensionPoint.getExtensions();

How can I ensure my values will be used?

I think it's matter of setting right order of loading of plugin.xml files, so my plugin.xml will be last, and my values will overwrite theirs, but I'm not sure how to do it.

+1  A: 

Eclipse makes no guarantees about the order that extensions are seen. Further, there is no guaranteed lifecycle for when specific plugins are loaded. If you want a guarantee, you need to implement it manually, and that will probably require a change of plugin B.

Heath Borders