ItemFinder.getFirstMatchingItemName( List<String> nameList, String searchString, int filterType ) does this:
// If there are multiple matches, such that one is a substring of the
// others, choose the shorter one, on the grounds that the user would
// have included part of the unique section of the longer name if that
// was the item they actually intended. This makes it easier to refer
// to non-clockwork in-a-boxes, and DoD potions by flavor.
BEFORE applying the filter. If this results in a single match, it is returned.
It then filters, and then it does exactly the same check again.
Net result is that when the list is:
soft green echo eyedrop antidote
soft green echo eyedrop antidote martini
the long name gets dropped before the filtering happens, and, since there is only one item left, it is returned, even though the remaining item will not pass the filtering.
Clearly, it needs to filter first. That would simplify that function. I'll look at it...