SSR: set loose matching to true by default

This commit is contained in:
Bas Leijdekkers
2017-10-15 11:40:58 +02:00
parent 85d799228a
commit 9f1766876d
10 changed files with 7 additions and 9 deletions
@@ -2,7 +2,8 @@ public class Test {
Object a = "a", b = "";
void mm() {
Object c = a;Object d = b;
Object c = a;
Object d = b;
String ololo = "intellij-idea";
}
}
@@ -1,6 +1,6 @@
class Test {
public static void test() {
String n = new AnInterface<String,Void>() {
String n = new AnInterface<String, Void>() {
@Override
public String invoke(Void v) {
return null;
@@ -1,6 +1,6 @@
class Test {
public static void test() {
String n = new AnInterface2<String,Void>() {
String n = new AnInterface2<String, Void>() {
@Override
public String invoke(Void v) {
return null;
@@ -9,7 +9,7 @@ class Test {
System.out.println(a.incrementAndGet(0));
a.getAndDecrement(0);
if (a.decrementAndGet(0) == 0) {
a.getAndAdd(0, ((2)));
a.getAndAdd(0, (2));
a.set(0, a.get(0) * 2);
if (a.get(0) == 0) {
System.out.println(a.get(0) + 7);
@@ -9,7 +9,7 @@ class Test {
System.out.println(++a[0]);
a[0]--;
if (--a[0] == 0) {
a[0] += ((2));
a[0] += 2;
a[0] = a[0] * 2;
if (a[0] == 0) {
System.out.println(a[0] + 7);
@@ -42,6 +42,7 @@ public class MatchOptions implements JDOMExternalizable {
public MatchOptions() {
variableConstraints = new LinkedHashMap<>();
looseMatching = true;
resultIsContextMatch = false;
myFileType = null;
myDialect = null;
@@ -86,7 +86,6 @@ public class Matcher {
if (StringUtil.isQuotedString(constraint)) {
// keep old configurations working, also useful for testing
final MatchOptions myMatchOptions = new MatchOptions();
myMatchOptions.setLooseMatching(true);
myMatchOptions.setFileType(fileType);
myMatchOptions.fillSearchCriteria(StringUtil.unquoteString(constraint));
return new Matcher(project, myMatchOptions);
@@ -751,7 +751,6 @@ public class SearchDialog extends DialogWrapper {
options.setScope(
searchWithinHierarchy && !myDoingOkAction ? GlobalSearchScope.projectScope(getProject()) : myScopeChooserCombo.getSelectedScope());
}
options.setLooseMatching(true);
options.setRecursiveSearch(isRecursiveSearchEnabled() && recursiveMatching.isSelected());
ourFtSearchVariant = (FileType)fileTypes.getSelectedItem();
@@ -34,7 +34,6 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
super.setUp();
final MatchOptions matchOptions = this.options.getMatchOptions();
matchOptions.setFileType(StdFileTypes.JAVA);
matchOptions.setLooseMatching(true);
}
public void testReplaceInLiterals() {
@@ -38,7 +38,6 @@ abstract class StructuralSearchTestCase extends LightQuickFixTestCase {
testMatcher = new Matcher(getProject());
options = new MatchOptions();
options.setLooseMatching(true);
options.setRecursiveSearch(true);
LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_5);
}