zero tolerance cleanup

- make test class without tests abstract
- private final methods
- suppress UnresolvedPluginConfigReference for compound ref
- remove redundant ;
- replace with text block
- always true/false

GitOrigin-RevId: 7a4864227e4aae22671f48cc7a0c5c7114e09bae
This commit is contained in:
Anna Kozlova
2024-02-06 10:37:47 +01:00
committed by intellij-monorepo-bot
parent b027de1e29
commit ed240eb3b2
4 changed files with 20 additions and 16 deletions

View File

@@ -218,7 +218,7 @@ public class InspectionApplicationBase implements CommandLineInspectionProgressR
runAnalysisOnScope(projectPath, parentDisposable, project, myInspectionProfile, scope); runAnalysisOnScope(projectPath, parentDisposable, project, myInspectionProfile, scope);
} }
private final @Nullable Project openProject(@NotNull Path projectPath, @NotNull Disposable parentDisposable) private @Nullable Project openProject(@NotNull Path projectPath, @NotNull Disposable parentDisposable)
throws InterruptedException, ExecutionException { throws InterruptedException, ExecutionException {
VirtualFile vfsProject = LocalFileSystem.getInstance().refreshAndFindFileByPath( VirtualFile vfsProject = LocalFileSystem.getInstance().refreshAndFindFileByPath(
FileUtil.toSystemIndependentName(projectPath.toString())); FileUtil.toSystemIndependentName(projectPath.toString()));

View File

@@ -82,7 +82,7 @@ public class Menu extends MenuItem {
return ""; return "";
TextWithMnemonic txt = TextWithMnemonic.parse(src); TextWithMnemonic txt = TextWithMnemonic.parse(src);
return txt == null ? "" : txt.getText(); return txt.getText();
} }
public static void renameAppMenuItems() { public static void renameAppMenuItems() {

View File

@@ -43,11 +43,12 @@ public class ActionsTest extends IntegrationTestCase {
a.finish(); a.finish();
List<Revision> rr = getRevisionsFor(f); List<Revision> rr = getRevisionsFor(f);
assertEquals("current: doc2\n" + assertEquals("""
"action: doc1\n" + current: doc2
"null: file2\n" + action: doc1
"null: file1\n" + null: file2
"External change: null", getNameAndOldContent(rr)); null: file1
External change: null""", getNameAndOldContent(rr));
} }
/** /**
@@ -67,11 +68,12 @@ public class ActionsTest extends IntegrationTestCase {
}, "command", null); }, "command", null);
List<Revision> rr = getRevisionsFor(f); List<Revision> rr = getRevisionsFor(f);
assertEquals("current: doc2\n" + assertEquals("""
"command: doc1\n" + current: doc2
"null: initial\n" + command: doc1
"null: \n" + null: initial
"External change: null", getNameAndOldContent(rr)); null:\s
External change: null""", getNameAndOldContent(rr));
} }
public void testActionInsideCommandSurroundedWithSomeChanges() throws Exception { public void testActionInsideCommandSurroundedWithSomeChanges() throws Exception {
@@ -94,10 +96,11 @@ public class ActionsTest extends IntegrationTestCase {
}, "command", null); }, "command", null);
List<Revision> rr = getRevisionsFor(f); List<Revision> rr = getRevisionsFor(f);
assertEquals("current: doc3\n" + assertEquals("""
"command: doc1\n" + current: doc3
"null: \n" + command: doc1
"External change: null", getNameAndOldContent(rr)); null:\s
External change: null""", getNameAndOldContent(rr));
} }
private static @NotNull String getNameAndOldContent(@NotNull List<Revision> revisions) { private static @NotNull String getNameAndOldContent(@NotNull List<Revision> revisions) {

View File

@@ -75,6 +75,7 @@ class SearchEverywhereMlExperiment {
fun isLoggingEnabledForTab(tabId: String) = tabsWithEnabledLogging.contains(tabId) fun isLoggingEnabledForTab(tabId: String) = tabsWithEnabledLogging.contains(tabId)
@Suppress("UnresolvedPluginConfigReference")
private fun isDisableExperiments(tab: SearchEverywhereTabWithMlRanking): Boolean { private fun isDisableExperiments(tab: SearchEverywhereTabWithMlRanking): Boolean {
return Registry.`is`("search.everywhere.force.disable.experiment.${tab.name.lowercase()}.ml") return Registry.`is`("search.everywhere.force.disable.experiment.${tab.name.lowercase()}.ml")
} }