| Summary: | [Contributions] DCR - ObjectContributor has incomplete implementation of 'verifyNameMatch' (1GDS25O) | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Dejan Glozic <dejan> |
| Component: | UI | Assignee: | 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: | |||
PRODUCT VERSION: 106 Defer Reopened for investigation Reopen No futher changes expected. |
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.