Bug 24452

Summary: Key clashes within extension point definitions
Product: [Eclipse Project] Platform Reporter: Darin Swanson <Darin_Swanson>
Component: AntAssignee: Jared Burns <jared_burns>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2 Keywords: core
Version: 2.0   
Target Milestone: 2.1 M2   
Hardware: PC   
OS: other   
Whiteboard:

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.