Bug 61952 - Bad deprecation -- IJavaSearchConstants#CASE_SENSITIVE
Summary: Bad deprecation -- IJavaSearchConstants#CASE_SENSITIVE
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-12 13:45 EDT by Steven Wasleski CLA
Modified: 2004-05-18 18:30 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Wasleski CLA 2004-05-12 13:45:09 EDT
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.
Comment 1 Jerome Lanneluc CLA 2004-05-14 06:16:52 EDT
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.
Comment 2 Olivier Thomann CLA 2004-05-18 18:30:47 EDT
Verified in 200405180816