From 3b2374df43b0f398b923e8501a4ed36720ed9d4b Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 22 Apr 2019 16:13:43 -0700 Subject: [PATCH] java analysis lints cleanup --- src/io/flutter/inspector/InspectorInstanceRef.java | 1 - src/io/flutter/logging/text/LineParser.java | 1 - src/io/flutter/run/bazelTest/BazelTestFields.java | 1 + .../unit/io/flutter/testing/AdaptedFixture.java | 14 ++++++++------ 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/io/flutter/inspector/InspectorInstanceRef.java b/src/io/flutter/inspector/InspectorInstanceRef.java index c29f8df3d9..f115b5c402 100644 --- a/src/io/flutter/inspector/InspectorInstanceRef.java +++ b/src/io/flutter/inspector/InspectorInstanceRef.java @@ -23,7 +23,6 @@ public InspectorInstanceRef(String id) { @Override public boolean equals(Object other) { - //noinspection SimplifiableIfStatement if (other instanceof InspectorInstanceRef) { final InspectorInstanceRef otherRef = (InspectorInstanceRef)other; return Objects.equals(id, otherRef.id); diff --git a/src/io/flutter/logging/text/LineParser.java b/src/io/flutter/logging/text/LineParser.java index e30ee11ed2..fff3c495aa 100644 --- a/src/io/flutter/logging/text/LineParser.java +++ b/src/io/flutter/logging/text/LineParser.java @@ -227,7 +227,6 @@ else if (style instanceof Integer) { } } - //noinspection MagicConstant return new SimpleTextAttributes(fontStyle, color); } diff --git a/src/io/flutter/run/bazelTest/BazelTestFields.java b/src/io/flutter/run/bazelTest/BazelTestFields.java index d1f6665375..bcd91305fb 100644 --- a/src/io/flutter/run/bazelTest/BazelTestFields.java +++ b/src/io/flutter/run/bazelTest/BazelTestFields.java @@ -58,6 +58,7 @@ public class BazelTestFields { /** * Copy constructor */ + @SuppressWarnings("CopyConstructorMissesField") BazelTestFields(@NotNull BazelTestFields template) { this(template.testName, template.entryFile, template.bazelTarget, template.additionalArgs); } diff --git a/testSrc/unit/io/flutter/testing/AdaptedFixture.java b/testSrc/unit/io/flutter/testing/AdaptedFixture.java index 7e833146a0..795432fd41 100644 --- a/testSrc/unit/io/flutter/testing/AdaptedFixture.java +++ b/testSrc/unit/io/flutter/testing/AdaptedFixture.java @@ -5,8 +5,6 @@ */ package io.flutter.testing; -import com.intellij.openapi.diagnostic.ExceptionWithAttachments; -import com.intellij.openapi.util.TraceableDisposable; import com.intellij.testFramework.fixtures.IdeaTestFixture; import org.junit.rules.TestRule; import org.junit.runner.Description; @@ -38,18 +36,22 @@ public void evaluate() throws Throwable { inner = factory.create(description.getClassName()); if (runOnDispatchThread) { Testing.runOnDispatchThread(inner::setUp); - } else { + } + else { inner.setUp(); } try { base.evaluate(); - } finally { + } + finally { if (runOnDispatchThread) { Testing.runOnDispatchThread(inner::tearDown); - } else { + } + else { try { inner.tearDown(); - } catch (RuntimeException ex) { + } + catch (RuntimeException ex) { // TraceableDisposable.DisposalException is private. // It gets thrown during CodeInsightTestFixtureImpl.tearDown, // apparently because of a Kotlin test framework convenience