Fix redundant initializers

This commit is contained in:
TacoTheDank 2020-05-29 14:53:01 -04:00
parent 71373d055d
commit 24f734f1b6
9 changed files with 10 additions and 10 deletions

View File

@ -113,7 +113,7 @@ public class DirectoryChooserActivity extends AppCompatActivity {
}); });
butNavUp.setOnClickListener(v -> { butNavUp.setOnClickListener(v -> {
File parent = null; File parent;
if (selectedDir != null if (selectedDir != null
&& (parent = selectedDir.getParentFile()) != null) { && (parent = selectedDir.getParentFile()) != null) {
changeDirectory(parent); changeDirectory(parent);

View File

@ -194,7 +194,7 @@ public class NavListAdapter extends BaseAdapter
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
int viewType = getItemViewType(position); int viewType = getItemViewType(position);
View v = null; View v;
if (viewType == VIEW_TYPE_NAV) { if (viewType == VIEW_TYPE_NAV) {
v = getNavView((String) getItem(position), position, convertView, parent); v = getNavView((String) getItem(position), position, convertView, parent);
} else if (viewType == VIEW_TYPE_SECTION_DIVIDER) { } else if (viewType == VIEW_TYPE_SECTION_DIVIDER) {

View File

@ -54,7 +54,7 @@ class NestedScrollableHost extends FrameLayout {
touchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
} }
private int touchSlop = 0; private int touchSlop;
private float initialX = 0f; private float initialX = 0f;
private float initialY = 0f; private float initialY = 0f;

View File

@ -121,7 +121,7 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
views.setOnClickPendingIntent(R.id.layout_left, startMediaPlayer); views.setOnClickPendingIntent(R.id.layout_left, startMediaPlayer);
try { try {
Bitmap icon = null; Bitmap icon;
int iconSize = getResources().getDimensionPixelSize(android.R.dimen.app_icon_size); int iconSize = getResources().getDimensionPixelSize(android.R.dimen.app_icon_size);
icon = Glide.with(PlayerWidgetJobService.this) icon = Glide.with(PlayerWidgetJobService.this)
.asBitmap() .asBitmap()

View File

@ -189,7 +189,7 @@ public class HttpDownloader extends Downloader {
} }
byte[] buffer = new byte[BUFFER_SIZE]; byte[] buffer = new byte[BUFFER_SIZE];
int count = 0; int count;
request.setStatusMsg(R.string.download_running); request.setStatusMsg(R.string.download_running);
Log.d(TAG, "Getting size of download"); Log.d(TAG, "Getting size of download");
request.setSize(responseBody.contentLength() + request.getSoFar()); request.setSize(responseBody.contentLength() + request.getSoFar());

View File

@ -582,7 +582,7 @@ public final class DBReader {
} }
private static String getImageAuthentication(final String imageUrl, PodDBAdapter adapter) { private static String getImageAuthentication(final String imageUrl, PodDBAdapter adapter) {
String credentials = null; String credentials;
try (Cursor cursor = adapter.getImageAuthenticationCursor(imageUrl)) { try (Cursor cursor = adapter.getImageAuthenticationCursor(imageUrl)) {
if (cursor.moveToFirst()) { if (cursor.moveToFirst()) {
String username = cursor.getString(0); String username = cursor.getString(0);

View File

@ -1218,7 +1218,7 @@ public class PodDBAdapter {
public Cursor searchItems(long feedID, String searchQuery) { public Cursor searchItems(long feedID, String searchQuery) {
String preparedQuery = prepareSearchQuery(searchQuery); String preparedQuery = prepareSearchQuery(searchQuery);
String queryFeedId = ""; String queryFeedId;
if (feedID != 0) { if (feedID != 0) {
// search items in specific feed // search items in specific feed
queryFeedId = KEY_FEED + " = " + feedID; queryFeedId = KEY_FEED + " = " + feedID;

View File

@ -519,8 +519,8 @@ public class GpodnetService implements ISyncService {
private String executeRequest(@NonNull Request.Builder requestB) throws GpodnetServiceException { private String executeRequest(@NonNull Request.Builder requestB) throws GpodnetServiceException {
Request request = requestB.build(); Request request = requestB.build();
String responseString = null; String responseString;
Response response = null; Response response;
ResponseBody body = null; ResponseBody body = null;
try { try {

View File

@ -39,7 +39,7 @@ class OggInputStream extends InputStream {
private void readOggPage() throws IOException { private void readOggPage() throws IOException {
// find OggS // find OggS
int[] buffer = new int[4]; int[] buffer = new int[4];
int c = 0; int c;
boolean isInOggS = false; boolean isInOggS = false;
while ((c = input.read()) != -1) { while ((c = input.read()) != -1) {
switch (c) { switch (c) {