Bug 2039 - [Contributions] DCR - ObjectContributor has incomplete implementation of 'verifyNameMatch' (1GDS25O)
Summary: [Contributions] DCR - ObjectContributor has incomplete implementation of 'ver...
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Kevin Haaland CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2001-10-10 22:25 EDT by Dejan Glozic CLA
Modified: 2002-09-03 17:15 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 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.