From 60104b28d2c44ef5847d959c962a366b88a0883a Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 29 Sep 2025 15:48:53 +0200 Subject: [PATCH] cleanup GitOrigin-RevId: 1217e2adf8ae698ebbc2e6365d8181f298efca27 --- .../daemon/impl/GotoNextErrorHandler.java | 16 +++++++--------- .../extensions/SkipSlowExecutionCondition.java | 5 ++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/GotoNextErrorHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/GotoNextErrorHandler.java index 5245e4fcc24e..b13796daacca 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/GotoNextErrorHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/GotoNextErrorHandler.java @@ -49,7 +49,7 @@ public class GotoNextErrorHandler implements CodeInsightActionHandler { @Override public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile psiFile) { int caretOffset = editor.getCaretModel().getOffset(); - gotoNextError(project, editor, psiFile, caretOffset); + gotoNextError(project, psiFile, editor, caretOffset); } @Override @@ -57,7 +57,7 @@ public class GotoNextErrorHandler implements CodeInsightActionHandler { return false; } - private void gotoNextError(Project project, Editor editor, PsiFile psiFile, int caretOffset) { + private void gotoNextError(@NotNull Project project, @NotNull PsiFile psiFile, @NotNull Editor editor, int caretOffset) { SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project); DaemonCodeAnalyzerSettings settings = DaemonCodeAnalyzerSettings.getInstance(); int maxSeverity = settings.isNextErrorActionGoesToErrorsFirst() ? severityRegistrar.getSeveritiesCount() - 1 @@ -109,7 +109,7 @@ public class GotoNextErrorHandler implements CodeInsightActionHandler { return infoToGo[0][0]; } - private HighlightInfo getBetterInfoThan(HighlightInfo infoToGo, int caretOffset, int startOffset, HighlightInfo info) { + private HighlightInfo getBetterInfoThan(HighlightInfo infoToGo, int caretOffset, int startOffset, @NotNull HighlightInfo info) { if (isBetterThan(infoToGo, caretOffset, startOffset)) { infoToGo = info; } @@ -127,7 +127,7 @@ public class GotoNextErrorHandler implements CodeInsightActionHandler { } } - private void showMessageWhenNoHighlights(Project project, PsiFile psiFile, Editor editor, int caretOffset) { + private void showMessageWhenNoHighlights(@NotNull Project project, @NotNull PsiFile psiFile, @NotNull Editor editor, int caretOffset) { DaemonCodeAnalyzerImpl codeHighlighter = (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(project); HintManagerImpl hintManager = HintManagerImpl.getInstanceImpl(); if (codeHighlighter.isErrorAnalyzingFinished(psiFile)) { @@ -142,16 +142,14 @@ public class GotoNextErrorHandler implements CodeInsightActionHandler { Disposable hintDisposable = Disposer.newDisposable("GotoNextErrorHandler.showMessageWhenNoHighlights"); Disposer.register(project, hintDisposable); - hint.addHintListener((eventObject) -> { - Disposer.dispose(hintDisposable); - }); + hint.addHintListener(__ -> Disposer.dispose(hintDisposable)); MessageBusConnection busConnection = project.getMessageBus().connect(hintDisposable); busConnection.subscribe(DaemonCodeAnalyzer.DAEMON_EVENT_TOPIC, new DaemonCodeAnalyzer.DaemonListener() { @Override public void daemonFinished() { hint.hide(); - gotoNextError(project, editor, psiFile, caretOffset); + gotoNextError(project, psiFile, editor, caretOffset); } }); @@ -195,7 +193,7 @@ public class GotoNextErrorHandler implements CodeInsightActionHandler { if (highlighter != null) ProblemsView.selectHighlighterIfVisible(project, highlighter); } - private static int getNavigationPositionFor(HighlightInfo info, Document document) { + private static int getNavigationPositionFor(@NotNull HighlightInfo info, @NotNull Document document) { int start = info.getActualStartOffset(); int textLength = document.getTextLength(); if (start >= textLength) return textLength; diff --git a/platform/testFramework/core/src/com/intellij/idea/extensions/SkipSlowExecutionCondition.java b/platform/testFramework/core/src/com/intellij/idea/extensions/SkipSlowExecutionCondition.java index 8d0e8a64fd45..45a99e59f806 100644 --- a/platform/testFramework/core/src/com/intellij/idea/extensions/SkipSlowExecutionCondition.java +++ b/platform/testFramework/core/src/com/intellij/idea/extensions/SkipSlowExecutionCondition.java @@ -2,6 +2,7 @@ package com.intellij.idea.extensions; import com.intellij.testFramework.SkipSlowTestLocally; +import com.intellij.testFramework.TestFrameworkUtil; import org.junit.jupiter.api.extension.ConditionEvaluationResult; import org.junit.jupiter.api.extension.ExecutionCondition; import org.junit.jupiter.api.extension.ExtensionContext; @@ -10,11 +11,9 @@ import org.junit.platform.commons.support.AnnotationSupport; public class SkipSlowExecutionCondition implements ExecutionCondition { private static final ConditionEvaluationResult ENABLED = ConditionEvaluationResult.enabled("Enabled locally"); private static final ConditionEvaluationResult DISABLED = ConditionEvaluationResult.disabled("Slow tests are disabled locally"); - private static final boolean SKIP_SLOW_TESTS = System.getProperty("skip.slow.tests.locally") != null; @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { - if (!SKIP_SLOW_TESTS) return ENABLED; - return AnnotationSupport.findAnnotation(context.getTestClass(), SkipSlowTestLocally.class).isPresent() ? DISABLED : ENABLED; + return TestFrameworkUtil.SKIP_SLOW && AnnotationSupport.findAnnotation(context.getTestClass(), SkipSlowTestLocally.class).isPresent() ? DISABLED : ENABLED; } }