From 5efb3569a1be832a2e33f9dbc66de38cbf4df5bd Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Thu, 27 Sep 2018 11:32:39 +0700 Subject: [PATCH] Unnecessary semicolons removed; some other warnings fixed --- .../compiler/artifacts/PackagingElementsTestCase.java | 1 - .../engine/SyntheticTypeComponentProvider.java | 2 +- .../openapi/roots/impl/IdeaProjectModelModifier.java | 1 - .../intention/impl/DeannotateIntentionAction.java | 1 - .../nullable/NullableStuffInspection.java | 2 +- .../JavaVariableInplaceIntroducer.java | 1 - .../introduceVariable/ReassignVariableUtil.java | 1 - .../src/com/intellij/codeInsight/TestFrameworks.java | 2 +- .../src/com/intellij/codeInsight/ExceptionUtil.java | 2 +- .../java/dependencyView/AnnotationsChangeTracker.java | 2 +- .../codeInspection/lang/RefManagerExtension.java | 6 ++++-- .../intellij/psi/templateLanguages/TreePatcher.java | 2 +- .../openapi/editor/markup/GutterDraggableObject.java | 4 ++-- .../project/manage/AbstractDependencyDataService.java | 3 +-- .../codeInsight/editorActions/SmartBackspaceMode.java | 2 +- .../impl/actions/GotoElementUnderCaretUsageBase.java | 6 +++--- .../src/com/intellij/openapi/wm/StatusBarWidget.java | 2 +- .../ide/ApplicationActivationStateManager.java | 8 ++++---- .../statistic/utils/StatisticsUploadAssistant.java | 2 +- .../com/intellij/openapi/keymap/impl/KeyState.java | 2 +- .../src/com/intellij/ui/ShowColorPickerAction.java | 3 +-- .../testframework/sm/runner/SMTRunnerTreeBuilder.java | 2 +- .../testFramework/ExpectedHighlightingData.java | 2 +- .../src/com/intellij/testFramework/PsiTestUtil.java | 1 - .../openapi/vcs/impl/VcsBackgroundableActions.java | 4 +--- .../ig/junit/JUnit5AssertionsConverterInspection.java | 11 +++++------ .../ManualArrayToCollectionCopyFixTest.java | 3 +-- .../config/execution/AntFinishedExecutionEvent.java | 2 +- .../git4idea/src/git4idea/push/GitPushRepoResult.java | 2 +- .../src/git4idea/remote/GitDefineRemoteDialog.java | 2 +- .../actions/AddGradleDslPluginActionHandler.java | 1 - .../test/runner/events/TestEventXmlXPathView.java | 2 +- .../actions/AddGradleDslDependencyActionHandler.java | 3 +-- .../psi/impl/signatures/GrClosureSignatureUtil.java | 2 +- .../introduce/field/GrInplaceFieldIntroducer.java | 2 -- .../variable/GrInplaceVariableIntroducer.java | 2 -- .../intentions/JavaFxInjectPageLanguageIntention.java | 1 - .../dom/intentions/AddMavenDependencyQuickFix.java | 1 - .../testng/inspection/BaseTestNGInspectionsTest.java | 2 +- .../impl/analysis/RearrangeAttributesIntention.java | 2 +- .../intellij/xml/actions/GenerateXmlTagAction.java | 3 +-- 41 files changed, 43 insertions(+), 62 deletions(-) diff --git a/java/compiler/tests/com/intellij/compiler/artifacts/PackagingElementsTestCase.java b/java/compiler/tests/com/intellij/compiler/artifacts/PackagingElementsTestCase.java index db3a27148ea6..71849fd6d34e 100644 --- a/java/compiler/tests/com/intellij/compiler/artifacts/PackagingElementsTestCase.java +++ b/java/compiler/tests/com/intellij/compiler/artifacts/PackagingElementsTestCase.java @@ -90,7 +90,6 @@ public abstract class PackagingElementsTestCase extends ArtifactsTestCase { if (module != null) { ModuleRootModificationUtil.addDependency(module, library, scope, false); } - ; return library; }); } diff --git a/java/debugger/openapi/src/com/intellij/debugger/engine/SyntheticTypeComponentProvider.java b/java/debugger/openapi/src/com/intellij/debugger/engine/SyntheticTypeComponentProvider.java index fee2a1766af6..74132ecd6c8f 100644 --- a/java/debugger/openapi/src/com/intellij/debugger/engine/SyntheticTypeComponentProvider.java +++ b/java/debugger/openapi/src/com/intellij/debugger/engine/SyntheticTypeComponentProvider.java @@ -29,5 +29,5 @@ public interface SyntheticTypeComponentProvider { //override this method to prevent other providers treating type component as synthetic default boolean isNotSynthetic(TypeComponent typeComponent) { return false; - }; + } } diff --git a/java/idea-ui/src/com/intellij/openapi/roots/impl/IdeaProjectModelModifier.java b/java/idea-ui/src/com/intellij/openapi/roots/impl/IdeaProjectModelModifier.java index 880ea9fa7838..b32aa484e41a 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/impl/IdeaProjectModelModifier.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/impl/IdeaProjectModelModifier.java @@ -109,7 +109,6 @@ public class IdeaProjectModelModifier extends JavaProjectModelModifier { for (Module module : modules) { ModuleRootModificationUtil.addDependency(module, library, scope, false); } - ; }); } } diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/DeannotateIntentionAction.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/DeannotateIntentionAction.java index b395d154951c..4448daaa678e 100644 --- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/DeannotateIntentionAction.java +++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/DeannotateIntentionAction.java @@ -165,7 +165,6 @@ public class DeannotateIntentionAction implements IntentionAction, LowPriorityAc if (annotationsManager.deannotate(listOwner, qualifiedName) && virtualFile != null && virtualFile.isInLocalFileSystem()) { UndoUtil.markPsiFileForUndo(file); } - ; }); } diff --git a/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java b/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java index 515fb3bbe1a8..02e1892784d6 100644 --- a/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspection.java @@ -155,5 +155,5 @@ public class NullableStuffInspection extends NullableStuffInspectionBase { public boolean startInWriteAction() { return false; } - }; + } } diff --git a/java/java-impl/src/com/intellij/refactoring/introduceVariable/JavaVariableInplaceIntroducer.java b/java/java-impl/src/com/intellij/refactoring/introduceVariable/JavaVariableInplaceIntroducer.java index ff957fc9eb59..18d47be97e30 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceVariable/JavaVariableInplaceIntroducer.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceVariable/JavaVariableInplaceIntroducer.java @@ -248,7 +248,6 @@ public class JavaVariableInplaceIntroducer extends AbstractJavaInplaceIntroducer if (variable != null) { finalListener.perform(myCanBeFinalCb.isSelected(), variable); } - ; }); } }); diff --git a/java/java-impl/src/com/intellij/refactoring/introduceVariable/ReassignVariableUtil.java b/java/java-impl/src/com/intellij/refactoring/introduceVariable/ReassignVariableUtil.java index 76ddd0a57095..2edba811f615 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceVariable/ReassignVariableUtil.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceVariable/ReassignVariableUtil.java @@ -170,7 +170,6 @@ public class ReassignVariableUtil { if (modifierList != null) { modifierList.setModifierProperty(PsiModifier.FINAL, false); } - ; }); finishTemplate(editor); } diff --git a/java/java-psi-api/src/com/intellij/codeInsight/TestFrameworks.java b/java/java-psi-api/src/com/intellij/codeInsight/TestFrameworks.java index 467921648d49..524234c3f624 100644 --- a/java/java-psi-api/src/com/intellij/codeInsight/TestFrameworks.java +++ b/java/java-psi-api/src/com/intellij/codeInsight/TestFrameworks.java @@ -63,7 +63,7 @@ public abstract class TestFrameworks { } for (TestFramework framework : TestFramework.EXTENSION_NAME.getExtensionList()) { - if (frameworks.contains(framework)) continue;; + if (frameworks.contains(framework)) continue; if (framework.findSetUpMethod(psiClass) != null || framework.findTearDownMethod(psiClass) != null) { frameworks.add(framework); } diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java b/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java index c6d45e0e84c3..81a3037610f7 100644 --- a/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java +++ b/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java @@ -744,7 +744,7 @@ public class ExceptionUtil { static HandlePlace fromBoolean(boolean isHandled) { return isHandled ? UNKNOWN : UNHANDLED; - }; + } } @NotNull diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/AnnotationsChangeTracker.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/AnnotationsChangeTracker.java index 62378ef1943b..6a9e93567736 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/AnnotationsChangeTracker.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/AnnotationsChangeTracker.java @@ -57,7 +57,7 @@ public abstract class AnnotationsChangeTracker { * If present in the returned result set, the subclasses of the annotated class will be affected. * If returned for an annotated field/method, the subclasses of the class containing this field/method will be affected. */ - SUBCLASSES; + SUBCLASSES } /** diff --git a/platform/analysis-api/src/com/intellij/codeInspection/lang/RefManagerExtension.java b/platform/analysis-api/src/com/intellij/codeInspection/lang/RefManagerExtension.java index 31e9e349948e..d7bac9ba622f 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/lang/RefManagerExtension.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/lang/RefManagerExtension.java @@ -3,7 +3,9 @@ package com.intellij.codeInspection.lang; import com.intellij.codeInspection.LocalInspectionTool; -import com.intellij.codeInspection.reference.*; +import com.intellij.codeInspection.reference.RefElement; +import com.intellij.codeInspection.reference.RefEntity; +import com.intellij.codeInspection.reference.RefVisitor; import com.intellij.lang.Language; import com.intellij.openapi.util.Key; import com.intellij.psi.PsiElement; @@ -24,7 +26,7 @@ public interface RefManagerExtension { @NotNull default Collection getLanguages() { return Collections.singleton(getLanguage()); - }; + } @Deprecated @NotNull diff --git a/platform/core-impl/src/com/intellij/psi/templateLanguages/TreePatcher.java b/platform/core-impl/src/com/intellij/psi/templateLanguages/TreePatcher.java index 76edb38689d2..76e6cf634fa5 100644 --- a/platform/core-impl/src/com/intellij/psi/templateLanguages/TreePatcher.java +++ b/platform/core-impl/src/com/intellij/psi/templateLanguages/TreePatcher.java @@ -58,7 +58,7 @@ public interface TreePatcher { @NotNull TextRange rangeToRemove, @NotNull CharTable table) { CharSequence chars = leaf.getChars(); - String res = rangeToRemove.replace(chars.toString(), "");; + String res = rangeToRemove.replace(chars.toString(), ""); LeafElement newLeaf = ASTFactory.leaf(leaf.getElementType(), table.intern(res)); leaf.rawInsertBeforeMe(newLeaf); leaf.rawRemove(); diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/GutterDraggableObject.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/GutterDraggableObject.java index 65b00fcfa845..9fde284599c1 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/GutterDraggableObject.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/GutterDraggableObject.java @@ -53,7 +53,7 @@ public interface GutterDraggableObject { */ Cursor getCursor(int line, int actionId); - default void remove() {}; + default void remove() {} - static DataFlavor[] getFlavors() {return new DataFlavor[] {flavor};}; + static DataFlavor[] getFlavors() {return new DataFlavor[] {flavor};} } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractDependencyDataService.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractDependencyDataService.java index 5dbdbbf76aa9..2cc912cf81ef 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractDependencyDataService.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractDependencyDataService.java @@ -29,7 +29,6 @@ import com.intellij.openapi.project.ProjectBundle; import com.intellij.openapi.roots.*; import com.intellij.openapi.util.Computable; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.util.ObjectUtils; import com.intellij.util.PathUtil; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.ContainerUtilRt; @@ -128,7 +127,7 @@ public abstract class AbstractDependencyDataService l - r), - BACKWARD((l, r) -> r - l); + FORWARD(Comparator.naturalOrder()), + BACKWARD(Comparator.reverseOrder()); public final Comparator ordering; Direction(Comparator ordering) { this.ordering = ordering; } - }; + } } diff --git a/platform/platform-api/src/com/intellij/openapi/wm/StatusBarWidget.java b/platform/platform-api/src/com/intellij/openapi/wm/StatusBarWidget.java index 44486a3b53e8..1dfd7dd77bef 100644 --- a/platform/platform-api/src/com/intellij/openapi/wm/StatusBarWidget.java +++ b/platform/platform-api/src/com/intellij/openapi/wm/StatusBarWidget.java @@ -62,7 +62,7 @@ public interface StatusBarWidget extends Disposable { @NotNull @Deprecated - default String getMaxPossibleText() { return ""; }; + default String getMaxPossibleText() { return ""; } float getAlignment(); } diff --git a/platform/platform-impl/src/com/intellij/ide/ApplicationActivationStateManager.java b/platform/platform-impl/src/com/intellij/ide/ApplicationActivationStateManager.java index fd5adff150b8..3358b6441dd0 100644 --- a/platform/platform-impl/src/com/intellij/ide/ApplicationActivationStateManager.java +++ b/platform/platform-impl/src/com/intellij/ide/ApplicationActivationStateManager.java @@ -40,13 +40,13 @@ public class ApplicationActivationStateManager { DEACTIVATING; public boolean isInactive () { - return !this.equals(ACTIVE); + return this != ACTIVE; } public boolean isActive() { - return this.equals(ACTIVE); + return this == ACTIVE; } - }; + } private static State state = State.DEACTIVATED; @@ -91,7 +91,7 @@ public class ApplicationActivationStateManager { @Override public void actionPerformed(ActionEvent evt) { - if (state.equals(State.DEACTIVATING)) { + if (state == State.DEACTIVATING) { state = State.DEACTIVATED; LOG.debug("The app is in the deactivated state"); diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUploadAssistant.java b/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUploadAssistant.java index 37d150e5665d..2670aa0f2337 100755 --- a/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUploadAssistant.java +++ b/platform/platform-impl/src/com/intellij/internal/statistic/utils/StatisticsUploadAssistant.java @@ -28,7 +28,7 @@ public class StatisticsUploadAssistant { private static final String IDEA_SUPPRESS_REPORT_STATISTICS = "idea.suppress.statistics.report"; public static final Object LOCK = new Object(); - private StatisticsUploadAssistant(){}; + private StatisticsUploadAssistant(){} public static boolean isShouldShowNotification() { return UsageStatisticsPersistenceComponent.getInstance().isShowNotification() && diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeyState.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeyState.java index 615e96f4d36d..7926c1a5ccbd 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeyState.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeyState.java @@ -21,6 +21,6 @@ public enum KeyState { STATE_SECOND_STROKE_IN_PROGRESS, STATE_PROCESSED, STATE_KEY_GESTURE_PROCESSOR, - STATE_WAIT_FOR_POSSIBLE_ALT_GR; + STATE_WAIT_FOR_POSSIBLE_ALT_GR } diff --git a/platform/platform-impl/src/com/intellij/ui/ShowColorPickerAction.java b/platform/platform-impl/src/com/intellij/ui/ShowColorPickerAction.java index 3eafba73966d..0896bba78fcb 100644 --- a/platform/platform-impl/src/com/intellij/ui/ShowColorPickerAction.java +++ b/platform/platform-impl/src/com/intellij/ui/ShowColorPickerAction.java @@ -19,7 +19,6 @@ import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.project.DumbAwareAction; -import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -54,7 +53,7 @@ public class ShowColorPickerAction extends DumbAwareAction { private static Window parent() { Window activeWindow = null; for (Window w : Window.getWindows()) { - if (w.isActive()) {activeWindow = w;}; + if (w.isActive()) {activeWindow = w;} } return activeWindow; } diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerTreeBuilder.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerTreeBuilder.java index 96fedcdce4e6..0a7b7399783a 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerTreeBuilder.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerTreeBuilder.java @@ -104,7 +104,7 @@ public class SMTRunnerTreeBuilder implements Disposable, AbstractTestTreeBuilder @NotNull private static TreeVisitor visitor(@NotNull AbstractTestProxy proxy) { return path -> { - BaseTestProxyNodeDescriptor descriptor = TreeUtil.getLastUserObject(BaseTestProxyNodeDescriptor.class, path);; + BaseTestProxyNodeDescriptor descriptor = TreeUtil.getLastUserObject(BaseTestProxyNodeDescriptor.class, path); assert descriptor != null; AbstractTestProxy currentProxy = descriptor.getElement(); if (currentProxy == proxy) return TreeVisitor.Action.INTERRUPT; diff --git a/platform/testFramework/src/com/intellij/testFramework/ExpectedHighlightingData.java b/platform/testFramework/src/com/intellij/testFramework/ExpectedHighlightingData.java index e236e6db3e78..45b5c8150761 100644 --- a/platform/testFramework/src/com/intellij/testFramework/ExpectedHighlightingData.java +++ b/platform/testFramework/src/com/intellij/testFramework/ExpectedHighlightingData.java @@ -611,7 +611,7 @@ public class ExpectedHighlightingData { assert start != null: "textLength = " + text.length() + ", startOffset = " + startOffset; LineColumn end = StringUtil.offsetToLineColumn(text, endOffset); - assert end != null : "textLength = " + text.length() + ", endOffset = " + endOffset;; + assert end != null : "textLength = " + text.length() + ", endOffset = " + endOffset; if (start.line == end.line) { return String.format("(%d:%d/%d)", start.line + 1, start.column + 1, end.column - start.column); diff --git a/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java index bbcc0aef27f8..5b7b8498756c 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java @@ -407,7 +407,6 @@ public class PsiTestUtil { model.dispose(); throw t; } - ; return dep; }); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/VcsBackgroundableActions.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/VcsBackgroundableActions.java index 1abb6dd9245a..85a5e665e388 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/VcsBackgroundableActions.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/VcsBackgroundableActions.java @@ -15,12 +15,10 @@ */ package com.intellij.openapi.vcs.impl; -import com.intellij.openapi.vfs.VirtualFile; - public enum VcsBackgroundableActions { ANNOTATE, COMPARE_WITH, // common for compare with (selected/latest/same) revision CREATE_HISTORY_SESSION, HISTORY_FOR_SELECTION, - COMMITTED_CHANGES_DETAILS; + COMMITTED_CHANGES_DETAILS } diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/junit/JUnit5AssertionsConverterInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/junit/JUnit5AssertionsConverterInspection.java index 164aa1030cf4..da74cec37db0 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/junit/JUnit5AssertionsConverterInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/junit/JUnit5AssertionsConverterInspection.java @@ -36,7 +36,7 @@ import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; public class JUnit5AssertionsConverterInspection extends BaseInspection { - private String myFrameworkName = "JUnit5";; + private String myFrameworkName = "JUnit5"; JUnit5AssertionsConverterInspection(String frameworkName) { myFrameworkName = frameworkName; @@ -75,7 +75,7 @@ public class JUnit5AssertionsConverterInspection extends BaseInspection { @Override public void visitMethodCallExpression(PsiMethodCallExpression expression) { doCheck(expression, - () -> AssertHint.create(expression, methodName -> AssertHint.JUnitCommonAssertNames.ASSERT_METHOD_2_PARAMETER_COUNT.get(methodName), false), + () -> AssertHint.create(expression, AssertHint.JUnitCommonAssertNames.ASSERT_METHOD_2_PARAMETER_COUNT::get, false), psiMethod -> { final PsiClass containingClass = psiMethod.getContainingClass(); if (containingClass == null) { @@ -92,7 +92,7 @@ public class JUnit5AssertionsConverterInspection extends BaseInspection { @Override public void visitMethodReferenceExpression(PsiMethodReferenceExpression expression) { doCheck(expression, - () -> AssertHint.create(expression, methodName -> AssertHint.JUnitCommonAssertNames.ASSERT_METHOD_2_PARAMETER_COUNT.get(methodName), false), + () -> AssertHint.create(expression, AssertHint.JUnitCommonAssertNames.ASSERT_METHOD_2_PARAMETER_COUNT::get, false), psiMethod -> { final PsiClass containingClass = psiMethod.getContainingClass(); if (containingClass == null) { @@ -181,7 +181,7 @@ public class JUnit5AssertionsConverterInspection extends BaseInspection { PsiElement element = descriptor.getPsiElement(); if (element instanceof PsiMethodReferenceExpression) { AssertHint assertHint = - AssertHint.create((PsiMethodReferenceExpression)element, methodName -> AssertHint.JUnitCommonAssertNames.ASSERT_METHOD_2_PARAMETER_COUNT.get(methodName), false); + AssertHint.create((PsiMethodReferenceExpression)element, AssertHint.JUnitCommonAssertNames.ASSERT_METHOD_2_PARAMETER_COUNT::get, false); if (assertHint != null) { replaceQualifier(project, assertHint.getMethod().getName(), (PsiReferenceExpression)element); } @@ -194,8 +194,7 @@ public class JUnit5AssertionsConverterInspection extends BaseInspection { } AssertHint assertHint = - AssertHint.create(methodCallExpression, methodName -> AssertHint.JUnitCommonAssertNames.ASSERT_METHOD_2_PARAMETER_COUNT - .get(methodName), false); + AssertHint.create(methodCallExpression, AssertHint.JUnitCommonAssertNames.ASSERT_METHOD_2_PARAMETER_COUNT::get, false); if (assertHint == null) { return; } diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/performance/ManualArrayToCollectionCopyFixTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/performance/ManualArrayToCollectionCopyFixTest.java index 5288b2e16d6f..b29da856548b 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/performance/ManualArrayToCollectionCopyFixTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/performance/ManualArrayToCollectionCopyFixTest.java @@ -16,7 +16,6 @@ package com.siyeh.ig.fixes.performance; import com.intellij.codeInspection.CommonQuickFixBundle; -import com.siyeh.InspectionGadgetsBundle; import com.siyeh.ig.IGQuickFixesTestCase; import com.siyeh.ig.performance.ManualArrayToCollectionCopyInspection; @@ -30,7 +29,7 @@ public class ManualArrayToCollectionCopyFixTest extends IGQuickFixesTestCase { super.setUp(); myFixture.enableInspections(new ManualArrayToCollectionCopyInspection()); myRelativePath = "performance/replace_with_add_all"; - myDefaultHint = CommonQuickFixBundle.message("fix.replace.with.x", "Collections.addAll(...,...)");; + myDefaultHint = CommonQuickFixBundle.message("fix.replace.with.x", "Collections.addAll(...,...)"); } public void testSimpleFor() { doTest(); } diff --git a/plugins/ant/src/com/intellij/lang/ant/config/execution/AntFinishedExecutionEvent.java b/plugins/ant/src/com/intellij/lang/ant/config/execution/AntFinishedExecutionEvent.java index 447f145af066..88ef10864cb4 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/execution/AntFinishedExecutionEvent.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/execution/AntFinishedExecutionEvent.java @@ -22,7 +22,7 @@ public class AntFinishedExecutionEvent extends AntExecutionEvent{ private final int myErrorCount; public enum Status { - SUCCESS, CANCELED, FAILURE; + SUCCESS, CANCELED, FAILURE } AntFinishedExecutionEvent(AntBuildFile buildFile, Status status, int errorCount) { diff --git a/plugins/git4idea/src/git4idea/push/GitPushRepoResult.java b/plugins/git4idea/src/git4idea/push/GitPushRepoResult.java index 46fc279d6e07..74c2519c5186 100644 --- a/plugins/git4idea/src/git4idea/push/GitPushRepoResult.java +++ b/plugins/git4idea/src/git4idea/push/GitPushRepoResult.java @@ -44,7 +44,7 @@ public class GitPushRepoResult { REJECTED_NO_FF, REJECTED_OTHER, ERROR, - NOT_PUSHED; + NOT_PUSHED } static Comparator TYPE_COMPARATOR = (o1, o2) -> o1.ordinal() - o2.ordinal(); diff --git a/plugins/git4idea/src/git4idea/remote/GitDefineRemoteDialog.java b/plugins/git4idea/src/git4idea/remote/GitDefineRemoteDialog.java index c7d6df5b02b7..8a42611e9bc2 100644 --- a/plugins/git4idea/src/git4idea/remote/GitDefineRemoteDialog.java +++ b/plugins/git4idea/src/git4idea/remote/GitDefineRemoteDialog.java @@ -73,7 +73,7 @@ public class GitDefineRemoteDialog extends DialogWrapper { @Override protected JComponent createCenterPanel() { return null; - }; + } @Nullable @Override diff --git a/plugins/gradle/java/src/codeInsight/actions/AddGradleDslPluginActionHandler.java b/plugins/gradle/java/src/codeInsight/actions/AddGradleDslPluginActionHandler.java index 519cd93c5878..12904e573c97 100644 --- a/plugins/gradle/java/src/codeInsight/actions/AddGradleDslPluginActionHandler.java +++ b/plugins/gradle/java/src/codeInsight/actions/AddGradleDslPluginActionHandler.java @@ -88,7 +88,6 @@ class AddGradleDslPluginActionHandler implements CodeInsightActionHandler { if (document != null) { documentManager.commitDocument(document); } - ; }); }; diff --git a/plugins/gradle/java/src/execution/test/runner/events/TestEventXmlXPathView.java b/plugins/gradle/java/src/execution/test/runner/events/TestEventXmlXPathView.java index b0e5f266a804..2fc95a9819d3 100644 --- a/plugins/gradle/java/src/execution/test/runner/events/TestEventXmlXPathView.java +++ b/plugins/gradle/java/src/execution/test/runner/events/TestEventXmlXPathView.java @@ -53,7 +53,7 @@ public class TestEventXmlXPathView implements TestEventXmlView { } catch (Exception ex) { throw new XmlParserException(ex); - }; + } } @NotNull diff --git a/plugins/gradle/java/src/integrations/maven/codeInsight/actions/AddGradleDslDependencyActionHandler.java b/plugins/gradle/java/src/integrations/maven/codeInsight/actions/AddGradleDslDependencyActionHandler.java index b774e95de214..12a489f8bb7f 100644 --- a/plugins/gradle/java/src/integrations/maven/codeInsight/actions/AddGradleDslDependencyActionHandler.java +++ b/plugins/gradle/java/src/integrations/maven/codeInsight/actions/AddGradleDslDependencyActionHandler.java @@ -66,7 +66,7 @@ class AddGradleDslDependencyActionHandler implements CodeInsightActionHandler { List closableBlocks = PsiTreeUtil.getChildrenOfTypeAsList(file, GrMethodCall.class); GrCall dependenciesBlock = ContainerUtil.find(closableBlocks, call -> { GrExpression expression = call.getInvokedExpression(); - return expression != null && "dependencies".equals(expression.getText()); + return "dependencies".equals(expression.getText()); }); if (dependenciesBlock == null) { @@ -86,7 +86,6 @@ class AddGradleDslDependencyActionHandler implements CodeInsightActionHandler { } } } - ; }); } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/signatures/GrClosureSignatureUtil.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/signatures/GrClosureSignatureUtil.java index 815d0366b8d8..0a56d5d72b65 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/signatures/GrClosureSignatureUtil.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/signatures/GrClosureSignatureUtil.java @@ -323,7 +323,7 @@ public class GrClosureSignatureUtil { } public enum ApplicabilityResult { - applicable, inapplicable, canBeApplicable, ambiguous; + applicable, inapplicable, canBeApplicable, ambiguous } @Nullable diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/field/GrInplaceFieldIntroducer.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/field/GrInplaceFieldIntroducer.java index ebff796d0605..5b424eb10976 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/field/GrInplaceFieldIntroducer.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/field/GrInplaceFieldIntroducer.java @@ -16,7 +16,6 @@ package org.jetbrains.plugins.groovy.refactoring.introduce.field; import com.intellij.codeInsight.TestFrameworks; -import com.intellij.openapi.application.Result; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -316,7 +315,6 @@ public class GrInplaceFieldIntroducer extends GrAbstractInplaceIntroducer