mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: cleanup
This commit is contained in:
+11
-17
@@ -4,7 +4,6 @@ package com.intellij.structuralsearch;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.util.ThrowableRunnable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -12,7 +11,6 @@ import java.io.IOException;
|
||||
/**
|
||||
* @author Maxim.Mossienko
|
||||
*/
|
||||
@SuppressWarnings({"ALL"})
|
||||
public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
|
||||
@Override
|
||||
@@ -1082,6 +1080,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void _testClassReplacement3() {
|
||||
String s37 = "class A { int a = 1; void B() {} int C(char ch) { int z = 1; } int b = 2; }";
|
||||
|
||||
@@ -1312,6 +1311,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
assertEquals("ReplaceReturnWithArrayInitializer", expectedResult, replacer.testReplace(searchIn,searchFor,replaceBy,options));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void _testClassReplacement10() throws IOException {
|
||||
String s1 = loadFile("before2.java");
|
||||
String s2 = "class '_Class {\n" +
|
||||
@@ -1332,7 +1332,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
assertEquals("Class replacement 10", expectedResult, replacer.testReplace(s1,s2,s3,options,true));
|
||||
}
|
||||
|
||||
public void testCatchReplacement() throws Exception {
|
||||
public void testCatchReplacement() {
|
||||
String s1 = "try {\n" +
|
||||
" aaa();\n" +
|
||||
"} catch(Exception ex) {\n" +
|
||||
@@ -1485,8 +1485,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
try {
|
||||
replacer.testReplace(s1,s2,s3,options);
|
||||
assertTrue("Undefined replace variable is not checked",false);
|
||||
} catch(UnsupportedPatternException ex) {
|
||||
|
||||
} catch(UnsupportedPatternException ignored) {
|
||||
}
|
||||
|
||||
String s4 = "a=a;";
|
||||
@@ -1496,13 +1495,13 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
try {
|
||||
replacer.testReplace(s4,s5,s6,options);
|
||||
assertTrue("Undefined no ; in replace",false);
|
||||
} catch(UnsupportedPatternException ex) {
|
||||
} catch(UnsupportedPatternException ignored) {
|
||||
}
|
||||
|
||||
try {
|
||||
replacer.testReplace(s4,s6,s5,options);
|
||||
assertTrue("Undefined no ; in search",false);
|
||||
} catch(UnsupportedPatternException ex) {
|
||||
} catch(UnsupportedPatternException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1590,7 +1589,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
assertEquals("Removing comments", expectedResult2, replacer.testReplace(s1,s2_2,s3,options));
|
||||
}
|
||||
|
||||
public void testTryCatchInLoop() throws Exception {
|
||||
public void testTryCatchInLoop() {
|
||||
String code = "for (int i = 0; i < MIMEHelper.MIME_MAP.length; i++)\n" +
|
||||
"{\n" +
|
||||
" String s = aFileNameWithOutExtention + MIMEHelper.MIME_MAP[i][0][0];\n" +
|
||||
@@ -1704,7 +1703,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testReformatAndShortenClassRefPerformance() throws IOException {
|
||||
public void testReformatAndShortenClassRefPerformance() {
|
||||
final String testName = getTestName(false);
|
||||
final String ext = "java";
|
||||
final String message = "Reformat And Shorten Class Ref Performance";
|
||||
@@ -1713,12 +1712,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
options.setToShortenFQN(true);
|
||||
|
||||
try {
|
||||
PlatformTestUtil.startPerformanceTest("SSR", 3500, new ThrowableRunnable() {
|
||||
public void run() {
|
||||
doTest(testName, ext, message);
|
||||
}
|
||||
}
|
||||
).useLegacyScaling().assertTiming();
|
||||
PlatformTestUtil.startPerformanceTest("SSR", 3500, () -> doTest(testName, ext, message)).useLegacyScaling().assertTiming();
|
||||
} finally {
|
||||
options.setToReformatAccordingToStyle(false);
|
||||
options.setToShortenFQN(false);
|
||||
@@ -1898,7 +1892,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
assertEquals(expected_4, replacer.testReplace(s1_4,s2,replacement,options));
|
||||
}
|
||||
|
||||
public void testReplaceFinalModifier() throws Exception {
|
||||
public void testReplaceFinalModifier() {
|
||||
String s1 = "class Foo {\n" +
|
||||
" void foo(final int i,final int i2, final int i3) {\n" +
|
||||
" final int x = 5;\n" +
|
||||
@@ -1927,7 +1921,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase {
|
||||
assertEquals(expected, replacer.testReplace(in, "private '_Type '_field = '_init;", "protected $Type$ $field$ = $init$;", options));
|
||||
}
|
||||
|
||||
public void testRemovingRedundancy() throws Exception {
|
||||
public void testRemovingRedundancy() {
|
||||
String s1 = "int a = 1;\n" +
|
||||
"a = 2;\n" +
|
||||
"int b = a;\n" +
|
||||
|
||||
Reference in New Issue
Block a user