Bug 571565

Summary: QuickAccessContents is inconsistent in handling letter case
Product: [Eclipse Project] Platform Reporter: Stephan Herrmann <stephan.herrmann>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.20   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

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