Community
Participate
Working Groups
In the I20040506-0200 build... The constant IJavaSearchConstants#CASE_SENSITIVE has been deprecated and the suggested replacement is SearchPattern#R_CASE_SENSITIVE. The problem is that IJavaSearchConstants#CASE_SENSITIVE is a boolean and SearchPattern#R_CASE_SENSITIVE is an int. Making the suggested change results in a compilation error rather than the deprecation warning. It is easy to work around the problem (don't change or just use true), but having a bad deprecation comment is a bit annoying. Also note that there seems to be a bit of an design mismatch between how SearchPattern and SearchEngine (both in org.eclipse.jdt.core.search) approach how search options are specified, in particular case sensitivity. The constants defined in SearchPattern are single bits that are expected to be operated on with the bitwise logical operators. However, in SearchEngine#searchAllTypeNames(...) case sensitivity is expected as a boolean separate from the other search options (use of this api is where the deprecation showed up for me). It is not a big deal now, but if they continue to diverge in the future, it could become one.
Yes there was an inconsistency. Thanks for reporting it. Changed the deprecation comment on IJavaSearchConstants#CASE_SENSITIVE to point at the matchRule methods, deprecated SearchEngine#searchAllTypeName(..., int matchMode, boolean isCaseSensitive, ...) and added SearchEngine#searchAllTypeName(..., int matchRule, ...). Also changed SearchTests to use this new API.
Verified in 200405180816