Bug 24452 - Key clashes within extension point definitions
Summary: Key clashes within extension point definitions
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: PC other
: P2 normal (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Jared Burns CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
Depends on:
Blocks:
 
Reported: 2002-10-07 10:46 EDT by Darin Swanson CLA
Modified: 2002-10-07 16:45 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Swanson CLA 2002-10-07 10:46:48 EDT
Found another problem where two plugins cannot implement the same extension 
point with the same library name (eg, "bin").  The reason is the following code 
in AntCorePlugin.  Notice the way the hash map is used, the last one in 
wins.

/**
 * Given an extension point name, extract its extensions and return them
 * as a Map. It uses as keys the attribute specified by the key parameter.
 */
private Map extractExtensions(String point, String key) {
	IExtensionPoint extensionPoint = 
getDescriptor().getExtensionPoint(point);
	if (extensionPoint == null)
		return null;
	IConfigurationElement[] extensions = 
extensionPoint.getConfigurationElements();
	Map result = new HashMap(extensions.length);
	for (int i = 0; i < extensions.length; i++) {
		String name = extensions[i].getAttribute(key);
		result.put(name, extensions[i]);
	}
	return result;
}
Comment 1 Darin Swanson CLA 2002-10-07 14:21:08 EDT
The use of Maps as the data structures was just wrong.  Moved to use Lists.
Fixed in AntCorePlugin and AntCorePreferences.

Please verify 
Comment 2 Jared Burns CLA 2002-10-07 16:45:07 EDT
Verified code. Looks good.