From 333d5cca776a541ef9f3aec1dc8feb6aa1a35cf7 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 14 Sep 2020 21:38:19 +0200 Subject: [PATCH] Cleanup (warnings) GitOrigin-RevId: 94b04ba88a48273ad51f3a0721d1db30049e261a --- updater/src/com/intellij/updater/Runner.java | 4 ++-- updater/src/com/intellij/updater/SwingUpdaterUI.java | 7 +++---- updater/src/com/intellij/updater/Utils.java | 3 +-- updater/src/ie/wombat/jbdiff/JBDiff.java | 9 +++++---- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/updater/src/com/intellij/updater/Runner.java b/updater/src/com/intellij/updater/Runner.java index dbf5348a0f5e..b3678c060e31 100644 --- a/updater/src/com/intellij/updater/Runner.java +++ b/updater/src/com/intellij/updater/Runner.java @@ -265,7 +265,7 @@ public class Runner { ui.startProcess("Packing JAR file '" + spec.getPatchFile() + "'..."); try (ZipOutputWrapper out = new ZipOutputWrapper(new FileOutputStream(spec.getPatchFile())); - ZipInputStream in = new ZipInputStream(new FileInputStream(new File(spec.getJarFile())))) { + ZipInputStream in = new ZipInputStream(new FileInputStream(spec.getJarFile()))) { ZipEntry e; while ((e = in.getNextEntry()) != null) { out.zipEntry(e, in); @@ -594,4 +594,4 @@ public class Runner { throw new IllegalStateException("Non-test logger already defined"); } } -} \ No newline at end of file +} diff --git a/updater/src/com/intellij/updater/SwingUpdaterUI.java b/updater/src/com/intellij/updater/SwingUpdaterUI.java index 3709b6020d68..e7f2f2a2f1ba 100644 --- a/updater/src/com/intellij/updater/SwingUpdaterUI.java +++ b/updater/src/com/intellij/updater/SwingUpdaterUI.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -@SuppressWarnings({"UseJBColor", "UseDPIAwareInsets", "UseDPIAwareBorders"}) +@SuppressWarnings({"UseJBColor", "UseDPIAwareBorders", "HardCodedStringLiteral"}) public class SwingUpdaterUI implements UpdaterUI { private static final EmptyBorder FRAME_BORDER = new EmptyBorder(8, 8, 8, 8); private static final EmptyBorder LABEL_BORDER = new EmptyBorder(0, 0, 5, 0); @@ -241,7 +241,6 @@ public class SwingUpdaterUI implements UpdaterUI { return "" + text + ""; } - @SuppressWarnings("SSBasedInspection") private static void invokeLater(Runnable runnable) { SwingUtilities.invokeLater(runnable); } @@ -348,7 +347,7 @@ public class SwingUpdaterUI implements UpdaterUI { private static class MyCellEditor extends DefaultCellEditor { MyCellEditor() { - super(new JComboBox()); + super(new JComboBox<>()); } @Override @@ -384,4 +383,4 @@ public class SwingUpdaterUI implements UpdaterUI { return result; } } -} \ No newline at end of file +} diff --git a/updater/src/com/intellij/updater/Utils.java b/updater/src/com/intellij/updater/Utils.java index 99d11935dd7b..d83f18628311 100644 --- a/updater/src/com/intellij/updater/Utils.java +++ b/updater/src/com/intellij/updater/Utils.java @@ -345,7 +345,6 @@ public class Utils { @Override @SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext") public synchronized void writeTo(OutputStream out) throws IOException { - //noinspection UnnecessarilyQualifiedStaticUsage Utils.writeBytes(buf, count, out); } } @@ -354,4 +353,4 @@ public class Utils { try { Thread.sleep(millis); } catch (InterruptedException ignore) { } } -} \ No newline at end of file +} diff --git a/updater/src/ie/wombat/jbdiff/JBDiff.java b/updater/src/ie/wombat/jbdiff/JBDiff.java index bc0380398280..81ca7872ccdc 100644 --- a/updater/src/ie/wombat/jbdiff/JBDiff.java +++ b/updater/src/ie/wombat/jbdiff/JBDiff.java @@ -30,7 +30,8 @@ import com.intellij.updater.Utils; import com.intellij.updater.Utils.OpenByteArrayOutputStream; import java.io.*; -import java.util.Stack; +import java.util.ArrayDeque; +import java.util.Deque; import java.util.zip.GZIPOutputStream; /** @@ -67,8 +68,8 @@ public class JBDiff { } private static void split(int[] I, int[] V, int initStart, int initLen, int h) { - Stack startStack = new Stack<>(); - Stack lenStack = new Stack<>(); + Deque startStack = new ArrayDeque<>(); + Deque lenStack = new ArrayDeque<>(); startStack.push(initStart); lenStack.push(initLen); while (!startStack.isEmpty()) { @@ -455,4 +456,4 @@ public class JBDiff { } return 0; } -} \ No newline at end of file +}