From 3b2df86fe73d336550de96515616ef8952d0734e Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Sun, 31 May 2020 02:35:50 -0400 Subject: [PATCH] Remove redundant initializers --- .../org/mariotaku/twidere/util/DataImportExportUtils.java | 6 +++--- .../oshkimaadziig/george/androidutils/SpanFormatter.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/DataImportExportUtils.java b/twidere/src/main/java/org/mariotaku/twidere/util/DataImportExportUtils.java index 21edb8925..dc1966a10 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/util/DataImportExportUtils.java +++ b/twidere/src/main/java/org/mariotaku/twidere/util/DataImportExportUtils.java @@ -170,7 +170,7 @@ public class DataImportExportUtils implements Constants { ZipInputStream zipInputStream = new ZipInputStream(inputStream)) { int flags = 0; List entryNames = new ArrayList<>(); - ZipEntry entry = null; + ZipEntry entry; while ((entry = zipInputStream.getNextEntry()) != null) { entryNames.add(entry.getName()); } @@ -204,11 +204,11 @@ public class DataImportExportUtils implements Constants { try (InputStream inputStream = context.getContentResolver().openInputStream(src.getUri()); ZipInputStream zipInputStream = new ZipInputStream(inputStream) ) { - ZipEntry entry = null; + ZipEntry entry; while ((entry = zipInputStream.getNextEntry()) != null) { StringBuilder stringBuilder = new StringBuilder(); byte[] buffer = new byte[1024]; - int read = 0; + int read; while ((read = zipInputStream.read(buffer, 0, 1024)) >= 0) { stringBuilder.append(new String(buffer, 0, read)); } diff --git a/twidere/src/main/java/org/oshkimaadziig/george/androidutils/SpanFormatter.java b/twidere/src/main/java/org/oshkimaadziig/george/androidutils/SpanFormatter.java index 6bd08caa8..d21139878 100644 --- a/twidere/src/main/java/org/oshkimaadziig/george/androidutils/SpanFormatter.java +++ b/twidere/src/main/java/org/oshkimaadziig/george/androidutils/SpanFormatter.java @@ -90,7 +90,7 @@ public class SpanFormatter { } else if (typeTerm.equals("%")) { cookedArg = "\n"; } else { - int argIdx = 0; + int argIdx; if (argTerm.equals("")) argIdx = ++argAt; else if (argTerm.equals("<")) argIdx = argAt; else argIdx = Integer.parseInt(argTerm.substring(0, argTerm.length() - 1)) - 1;