From cc52fa04fa871da2b9b2c3dc7e239bca51224272 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 22 Oct 2019 16:53:35 +0200 Subject: [PATCH] Enforce MultipleVariableDeclarations checkstyle --- .../NetworkPreferencesFragment.java | 3 ++- config/checkstyle/checkstyle.xml | 1 + .../core/event/DownloaderUpdate.java | 3 ++- .../core/glide/FastBlurTransformation.java | 19 ++++++++++++++++--- .../core/util/id3reader/ID3Reader.java | 3 ++- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/NetworkPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/NetworkPreferencesFragment.java index 440660942..34e8684ed 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/NetworkPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/NetworkPreferencesFragment.java @@ -134,7 +134,8 @@ public class NetworkPreferencesFragment extends PreferenceFragmentCompat { builder1.show(); }); builder.onNegative((dialog, which) -> { - int hourOfDay = 7, minute = 0; + int hourOfDay = 7; + int minute = 0; int[] updateTime = UserPreferences.getUpdateTimeOfDay(); if (updateTime.length == 2) { hourOfDay = updateTime[0]; diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index bcddda794..22952dcc4 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -32,6 +32,7 @@ value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/> + diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java b/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java index 9acd7728a..f549940b7 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java @@ -30,7 +30,8 @@ public class DownloaderUpdate { DownloaderUpdate(@NonNull List downloaders) { this.downloaders = downloaders; - LongList feedIds1 = new LongList(), mediaIds1 = new LongList(); + LongList feedIds1 = new LongList(); + LongList mediaIds1 = new LongList(); for(Downloader d1 : downloaders) { int type = d1.getDownloadRequest().getFeedfileType(); long id = d1.getDownloadRequest().getFeedfileId(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/glide/FastBlurTransformation.java b/core/src/main/java/de/danoeh/antennapod/core/glide/FastBlurTransformation.java index cbd22ceb0..3cc906b7f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/glide/FastBlurTransformation.java +++ b/core/src/main/java/de/danoeh/antennapod/core/glide/FastBlurTransformation.java @@ -83,7 +83,16 @@ public class FastBlurTransformation extends BitmapTransformation { int r[] = new int[wh]; int g[] = new int[wh]; int b[] = new int[wh]; - int rsum, gsum, bsum, x, y, i, p, yp, yi, yw; + int rsum; + int gsum; + int bsum; + int x; + int y; + int i; + int p; + int yp; + int yi; + int yw; int vmin[] = new int[Math.max(w, h)]; int divsum = (div + 1) >> 1; @@ -101,8 +110,12 @@ public class FastBlurTransformation extends BitmapTransformation { int[] sir; int rbs; int r1 = radius + 1; - int routsum, goutsum, boutsum; - int rinsum, ginsum, binsum; + int routsum; + int goutsum; + int boutsum; + int rinsum; + int ginsum; + int binsum; for (y = 0; y < h; y++) { rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3Reader.java b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3Reader.java index 7290b9d98..8589e1283 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3Reader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/id3reader/ID3Reader.java @@ -206,7 +206,8 @@ public class ID3Reader { private int readUnicodeString(StringBuilder strBuffer, InputStream input, int max, Charset charset) throws IOException, ID3ReaderException { byte[] buffer = new byte[max]; - int c, cZero = -1; + int c; + int cZero = -1; int i = 0; for (; i < max; i++) { c = input.read();