Bug 3056 - Possible problem dealing with multiple plugins with same id/version (1GF6L8K)
Summary: Possible problem dealing with multiple plugins with same id/version (1GF6L8K)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:48 EDT by Jeff McAffer CLA
Modified: 2002-01-29 10:14 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff McAffer CLA 2001-10-10 22:48:34 EDT
I understand that duplicate plugins should not exist in the system, but it is possible
	that during plugin development, different plugins with the same version and id
	may be loaded into the plugin registry.  This has happened to me while working on some
	SWT examples.  The latest build copy of the plugins was in dev\eclipse\plugins\..., and
	the new development edition was in target\eclipse\plugins\....  So when PDE started up
	(self-hosting Eclipse would do the same thing), both copies were included in the
	registry.

	The differences between the two versions were:
		- some code changes (no new classes)
		- one additional dependency

	It is the additional dependency that caused problems.  When trying to reference classes
	introduced into the plugin's runtime environment via the new dependency, the ClassLoader
	failed to find them - issuing a ClassDefNotFoundError.  Some other minor quirks as well
	in the data fetched from the PluginRegistry (the new dependency figured on both copies of
	the plugin, not just the second).

	Though this problem should never occur in practice, it may be helpful to add a couple lines
	to either:
		1) discard plugins with the same id and version as one already in the registry
		2) disambiguate seeming duplicates by appending an extra character to the version
		    number of those plugin id / version pairs that get registred twice so the
			assertions about there being only one plugin with a given id and version holds.

	JB (11/06/2001 8:16:28 PM)

NOTES:

JM (6/12/2001 3:07:20 PM)
	defer
Comment 1 DJ Houghton CLA 2001-10-24 06:42:35 EDT
PRODUCT VERSION:
	Build 122

Comment 2 John Arthorne CLA 2002-01-24 18:06:37 EST
Investigated in build 20020123; the behaviour is the same.  It continues to 
allow multiple plugins with the same ID, but problems can arise.  We should be 
trapping this while parsing/resolving the plugin registry.
Comment 3 John Arthorne CLA 2002-01-25 14:35:03 EST
I've written a fix in RegistryLoader, so that it skips duplicates and logs an 
appropriate error message.  Waiting to review with Debbie before releasing.  We 
also need a test case.
Comment 4 John Arthorne CLA 2002-01-29 10:14:09 EST
Fixed.  Now weeding out duplicate plugins in the RegistryLoader.