Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 2039

Summary: [Contributions] DCR - ObjectContributor has incomplete implementation of 'verifyNameMatch' (1GDS25O)
Product: [Eclipse Project] Platform Reporter: Dejan Glozic <dejan>
Component: UIAssignee: Kevin Haaland <Kevin_Haaland>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 Keywords: investigate
Version: 2.0   
Target Milestone: ---   
Hardware: All   
OS: Windows All   
Whiteboard:

Description Dejan Glozic CLA 2001-10-10 22:25:09 EDT
Method 'verifyNameMatch' in ObjectContributor looks like this:

/**
 * Verifies that the given name matches the given
 * wildcard filter. Returns true if it does.
 */
public static boolean verifyNameMatch(String name, String filter) {
	UIHackFinder.fixUI();
	//We should be using real wild care checker, not this one - that is lacking
	if (filter.startsWith("*")) {
		return name.toLowerCase().endsWith(filter.substring(1));
	} else
		if (filter.endsWith("*")) {
			return name.toLowerCase().endsWith(filter.toLowerCase().substring(0, filter.length() - 1));
		}
	return false;
}

This implementation is incomplete for the following reasons:

1) It does not take into account more complex wild card patterns (including those containing '?'). It can only
match cases like "*<name>" and "<partial_name>*" (and the fact that I wrote it does not help :-)).

2) It does not support exact match (if I want to register a contribution against "plugin.xml" only). I would
need to set my name filter to be "*plugin.xml" or "plugin.xml*" to fool it.

This code affects several extension points including pop-up actions and property pages (those
that are contributed against an object onto which name the filter is applied). It should be fixed
because it is a non-breaking change and no API is involved.


NOTES:

DS (5/16/01 2:52:09 PM)
	I have fixed problem 2.  
	Problem 1 is actually a feature request and can be deferred to future releases.
Comment 1 DJ Houghton CLA 2001-10-29 17:47:16 EST
PRODUCT VERSION:

106

Comment 2 Kevin Haaland CLA 2002-02-01 13:49:06 EST
Defer
Comment 3 Randy Giffen CLA 2002-08-07 10:45:49 EDT
Reopened for investigation
Comment 4 Randy Giffen CLA 2002-08-07 10:46:01 EDT
Reopen
Comment 5 Kevin Haaland CLA 2002-09-03 17:15:44 EDT
No futher changes expected.