Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 163922 - Fragments do not over-ride down level fragments
Summary: Fragments do not over-ride down level fragments
Status: RESOLVED INVALID
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 major with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-09 02:46 EST by Zhou Jian Xin CLA
Modified: 2006-12-08 18:14 EST (History)
2 users (show)

See Also:


Attachments
sample plugin (101.46 KB, application/x-zip-compressed)
2006-11-09 03:17 EST, Zhou Jian Xin CLA
no flags Details
screenshot (120.69 KB, image/pjpeg)
2006-11-09 03:20 EST, Zhou Jian Xin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zhou Jian Xin CLA 2006-11-09 02:46:35 EST
Plug-ins with the same ID in Eclipse over ride down level versions of the same plug-in. Fragments should have the same behaviour, and it is not documented otherwise in Eclipse 3.1. However, if the same fragment ID exists in Eclipse with two different version levels for some reason the lower level Fragment is displayed.

This has the implication that NL content can not be updated on locally installed ICs:

To view this problem in the base Eclipse package put the files attached in plugins.zip. Then view the help system in IC mode with browser local set to 'fr'. You will notice that all items in the Navigation Tree for the plugins will be prefixed "3.1.1" (used in fragment version 3.1.1) instead of "3.1.2" (used in fragment version 3.1.2).

Note: The only work around is to not only update the fragment version, but also the plug-in version and ensure that all fragments have match=perfect defined. This workaround is poor because it requires users to download a plug-in that is exactly the same with the exception that the plug-in version number is different. If match="perfect" is not defined on any of the installed fragments the only work around is to increase the plug-in and fragment version number so it is no longer compatible.

This is a severe limitation as it is not possible to update fragments only, which is why there are fragments in the first place.
Comment 1 Zhou Jian Xin CLA 2006-11-09 03:17:54 EST
Created attachment 53536 [details]
sample plugin
Comment 2 Zhou Jian Xin CLA 2006-11-09 03:20:09 EST
Created attachment 53537 [details]
screenshot
Comment 3 Curtis d'Entremont CLA 2006-11-09 10:26:31 EST
Sounds like a runtime issue.
Comment 4 Thomas Watson CLA 2006-11-27 11:03:34 EST
NL fragments must be singleton bundles.  The nl fragments attached here are using the old 2.1 format (only contain a plugin.xml and no bundle manifest META-INF/MANIFEST.MF file).  

The compatibility plugin converter that converts old-style plugin.xml files to bundle manifests will only make the plugin/fragment a singleton if the plugin.xml file contains an extensions/extension points or uses the singlton attribute.  I suggest you convert your old-style plug-ins to use OSGi manifests and specify them as singletons in the bundle manifest.  
(i.e. Bundle-SymbolicName: com.ibm.help.ic.doc.nl1; singleton:=true)
Comment 5 Tim Fletcher CLA 2006-12-08 18:14:58 EST
At runtime the compatibility plugin converter automatically generates the META-INF/MANIFEST.MF files in the configuration\org.eclipse.osgi\manifests directory for plug-ins that do not include the manifest file in the plug-in. The generated plug-in manifest file contains the text: "Bundle-SymbolicName: com.ibm.help.ic.doc; singleton:=true". The converter also automatically generates the META-INF/MANIFEST.MF files for the fragments but the "; signleton:=true" suffix is  not included in the file, and I do not see why fragments should be treated differently. Would there ever be a reason not to have a fragment of a plug-in as singleton?

The Eclipse 3.1 documentation does not make mention of a singleton attribute to use in plugin.xml or fragment.xml in the <a href="http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/misc/plugin_dtd.html">plugin.dtd</a>