Bug 571565 - QuickAccessContents is inconsistent in handling letter case
Summary: QuickAccessContents is inconsistent in handling letter case
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.20   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-27 15:47 EST by Stephan Herrmann CLA
Modified: 2021-02-27 15:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2021-02-27 15:47:20 EST
When you type an upper case letter into the filter of the Quick Access (or whatever it is named nowadays), some locations try to match that unprocessed filter against a toLowerCase;ed label, which will never match.

I observed this when typing "O" did not show the following view, although it should be a clean prefix match:

  <extension
         point="org.eclipse.ui.views">
      <category
            name="Object Teams"
            id="org.eclipse.objectteams.otdt.ui">
      </category>
      <view
            name="OT/Equinox Monitor"
			icon="icons/monitor.png"
            category="org.eclipse.objectteams.otdt.ui"
            class="org.eclipse.objectteams.eclipse.monitor.internal.MonitorView"
            id="org.eclipse.objectteams.eclipse.monitor.MonitorView">
         <description>
            Presentation of all teams instantiated by OT/Equinox.
Allows to interactively (de)activate a selected team.
         </description>
      </view>
   </extension>

Interestingly it does match for this view (highlighting the second to last letter as the match):
   <extension
         point="org.eclipse.ui.views">
      <view
            name="OT/J Language Definition"
            icon="icons/ot_paragraph.gif"
            category="org.eclipse.objectteams.otdt.ui"
            class="org.eclipse.objectteams.otdt.internal.ui.help.views.OTJLDView"
            id="org.eclipse.objectteams.otdt.ui.help.views.OTJLDView">
         <description>
            Browsable view of the OT/J Language Definition.
         </description>
      </view>
   </extension>

The bug appears to be in or around org.eclipse.ui.internal.quickaccess.QuickAccessContents.computeMatchingEntries(String, QuickAccessElement, int, IProgressMonitor)

* the incoming filter is verbatim as typed: "O"

* inside putPrefixMatchFirst() we use prefix.toLowerCase() - OK

* but: new QuickAccessMatcher(element).match(filter, provider) passes the prefix verbatim

* inside that match() method we have several "xy.toLowerCase().indexOf(filter)"
  => lhs lowerCased is compared to rhs uppercase