Community
Participate
Working Groups
The SearchPattern API for stringPattern searches to java elements is somewhat odd: There's a public constant R_CASE_SENSITIVE, which is not mentioned in the javadoc of createPattern(String stringPattern, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive) , and there's also an extra boolean parameter isCaseSensitive. I don't see why R_CASE_SENSITIVE is made public if it should not be used by clients. On the other hand, it could also be turned into an official bit-flag and the boolean isCaseSensitive removed. To have both options seems strange to me.
This was the intent, but somehow we left the old code in.
In I20040428, SearchPattern.isCaseSensitive() has been removed. However SearchPattern.createPattern(String stringPattern, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive) still exists. To be consistent I propose that we replace it with SearchPattern.createPattern(String stringPattern, int searchFor, int limitTo, int matchRule). Markus and Thomas, would JDT UI be able to switch to this new method for next integration build ?
Sure, it's just a matter of reaplacing the constant, right?
Yes this should be straightforward: createPattern(stringPattern, searchFor, limitTo, isCaseSensitive ? matchMode | R_CASE_SENSITIVE : matchMode)
Sounds good. Jerome, can you give us a migration period to avoid hassles with the breaking API change? It would be best for us if you could release the new SearchPattern.createPattern(String stringPattern, int searchFor, int limitTo, int matchRule) and still retain the old (deprecated) method with the boolean for a day. We could then migrate to the new API without ever having compile errors.
Added new API that takes a matchRule, and deprecated the old one. Please let me know when I can remove the old API.
I'll take care of the references in jdt.ui and jdt.junit tomorrow, so that we are ready to live without it by next Monday. I saw that jdt.debug.ui also has 2 references to the deprecated method. Jerome, could you contact them to know when they have migrated? BTW: The javadoc of the new method still contains old @param isCaseSensitive.
Thanks Markus for catching the @param problem. Darin, will you be able to move to the new API for next integration build?
Entered bug 60538 against JDT Debug as a reminder.
Removed references to the old method from jdt.ui and jdt.junit in HEAD.
Verified for 3.0 M9 with build I200405180816.