Bug 60257 SearchPattern API: R_CASE_SENSITIVE vs. boolean isCaseSensitive
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.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/MainMethodSearchEngine.java
* which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.ui.util;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.core.search.SearchMatch;
import org.eclipse.jdt.core.search.SearchPattern;
import org.eclipse.jdt.core.search.SearchRequestor;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.util.Assert;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.corext.util.SearchUtils;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.ui.IJavaElementSearchConstants;
public class MainMethodSearchEngine{