Bug 283709 - [open type] Wildcard + Camel Case don't mix
Summary: [open type] Wildcard + Camel Case don't mix
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.2   Edit
Hardware: PC Linux
: P4 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 284990
Blocks:
  Show dependency tree
 
Reported: 2009-07-16 10:10 EDT by Robert Konigsberg CLA
Modified: 2009-07-29 06:46 EDT (History)
2 users (show)

See Also:


Attachments
first screenshot (29.78 KB, image/jpeg)
2009-07-16 10:10 EDT, Robert Konigsberg CLA
no flags Details
second screenshot (31.59 KB, image/jpeg)
2009-07-16 10:11 EDT, Robert Konigsberg CLA
no flags Details
third screenshot (29.80 KB, image/jpeg)
2009-07-16 10:11 EDT, Robert Konigsberg CLA
no flags Details
fourth screenshot (24.15 KB, image/jpeg)
2009-07-16 10:11 EDT, Robert Konigsberg CLA
no flags Details
fifth screenshot (24.52 KB, image/jpeg)
2009-07-16 10:12 EDT, Robert Konigsberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Konigsberg CLA 2009-07-16 10:10:59 EDT
Created attachment 141779 [details]
first screenshot

Build ID: M20090211-1700

Steps To Reproduce:
I created three classes:

MyFirstCarConverterTest
MySecondCarConverterTest
MyFifthCarConverterTest.

Select Open Type.

Search for MFCCT. MyFirstCarConverterTest and MyFifthCarConverterTest appear. (See first screenshot)

Next search for My*Test. All three classes appear. (See second screenshot)

Third, MyFCCTest also returns the classes named First and Fifth. (third screenshot.)

Now let's try to add wildcards with camel casing.

M*CCT returns nothing (fourth screenshot), neither does My*CCTest (fifth screenshot.)

Is that a hard thing to do?

More information:
Comment 1 Robert Konigsberg CLA 2009-07-16 10:11:21 EDT
Created attachment 141780 [details]
second screenshot
Comment 2 Robert Konigsberg CLA 2009-07-16 10:11:40 EDT
Created attachment 141781 [details]
third screenshot
Comment 3 Robert Konigsberg CLA 2009-07-16 10:11:56 EDT
Created attachment 141782 [details]
fourth screenshot
Comment 4 Robert Konigsberg CLA 2009-07-16 10:12:09 EDT
Created attachment 141783 [details]
fifth screenshot
Comment 5 Trevor CLA 2009-07-28 15:43:36 EDT
Hey, I just ran into this too. Seems to be in more than just the Open Type dialog. I intially found it in the "Add Java Exception Breakpoint" dialog. The filter is prepopulated with "*Exception*" and I entered "NP" at the very beinging and was very suprised not to see NullPointerException in the listing.

Hope this one gets addressed soon.
Comment 6 Markus Keller CLA 2009-07-29 06:41:01 EDT
I see what you mean, but this was really designed to be either camel case or wildcards, but not both together. Wildcards have always been case insensitive in these dialogs. This needs to stay at least when the whole pattern is lowercase.

To add camel case support to wildcards, org.eclipse.jdt.core.search.SearchPattern and references to it in the search engine would have to be updated. In particular, they would have to allow combining R_PATTERN_MATCH with R_CAMELCASE_MATCH. SearchPattern#validateMatchRule(String, int) would have to accept both rules iff the stringPattern contains a wildcard and at least one uppercase character, but must continue to return just R_PATTERN_MATCH if the string contains only lowercase characters, wildcards, and '.'.
Comment 7 Markus Keller CLA 2009-07-29 06:46:41 EDT
> Is that a hard thing to do?

It's not trivial, since search APIs are involved (I filed bug 284990 for JDT/Core), and already the implementation details of simple camelCase matching are quite involved.