From cbfd6100af3f8d17d3fb2180947b0f5a8ea02f3c Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 9 Dec 2018 18:32:32 +0000 Subject: [PATCH] some code analysys noise --- app/src/main/java/net/ktnx/mobileledger/AccountSummary.java | 2 +- .../net/ktnx/mobileledger/AppCompatPreferenceActivity.java | 2 ++ .../main/java/net/ktnx/mobileledger/DatePickerFragment.java | 1 - .../main/java/net/ktnx/mobileledger/LedgerTransaction.java | 4 ++-- .../main/java/net/ktnx/mobileledger/UrlEncodedFormData.java | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java index dedc1005..79c5d709 100644 --- a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java +++ b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java @@ -139,7 +139,7 @@ public class AccountSummary extends AppCompatActivity { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. - int id = item.getItemId(); +// int id = item.getItemId(); //noinspection SimplifiableIfStatement //if (id == R.id.action_settings) { diff --git a/app/src/main/java/net/ktnx/mobileledger/AppCompatPreferenceActivity.java b/app/src/main/java/net/ktnx/mobileledger/AppCompatPreferenceActivity.java index 5dc341a4..2d25180a 100644 --- a/app/src/main/java/net/ktnx/mobileledger/AppCompatPreferenceActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/AppCompatPreferenceActivity.java @@ -4,6 +4,7 @@ import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceActivity; import android.support.annotation.LayoutRes; +import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatDelegate; @@ -41,6 +42,7 @@ public abstract class AppCompatPreferenceActivity extends PreferenceActivity { getDelegate().setSupportActionBar(toolbar); } + @NonNull @Override public MenuInflater getMenuInflater() { return getDelegate().getMenuInflater(); diff --git a/app/src/main/java/net/ktnx/mobileledger/DatePickerFragment.java b/app/src/main/java/net/ktnx/mobileledger/DatePickerFragment.java index a30913c0..bf674ff7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/DatePickerFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/DatePickerFragment.java @@ -7,7 +7,6 @@ import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatDialogFragment; -import android.util.Log; import android.widget.DatePicker; import android.widget.TextView; diff --git a/app/src/main/java/net/ktnx/mobileledger/LedgerTransaction.java b/app/src/main/java/net/ktnx/mobileledger/LedgerTransaction.java index 1690b936..51716cd1 100644 --- a/app/src/main/java/net/ktnx/mobileledger/LedgerTransaction.java +++ b/app/src/main/java/net/ktnx/mobileledger/LedgerTransaction.java @@ -12,7 +12,7 @@ class LedgerTransaction { LedgerTransaction(String date, String description) { this.date = date; this.description = description; - this.items = new ArrayList(); + this.items = new ArrayList<>(); } void add_item(LedgerTransactionItem item) { @@ -35,7 +35,7 @@ class LedgerTransaction { this.description = description; } - public Iterator getItemsIterator() { + Iterator getItemsIterator() { return new Iterator() { private int pointer = 0; @Override diff --git a/app/src/main/java/net/ktnx/mobileledger/UrlEncodedFormData.java b/app/src/main/java/net/ktnx/mobileledger/UrlEncodedFormData.java index 1e09d240..b729eefe 100644 --- a/app/src/main/java/net/ktnx/mobileledger/UrlEncodedFormData.java +++ b/app/src/main/java/net/ktnx/mobileledger/UrlEncodedFormData.java @@ -12,7 +12,7 @@ class UrlEncodedFormData { private List> pairs; UrlEncodedFormData() { - pairs = new ArrayList>(); + pairs = new ArrayList<>(); } void add_pair(String name, String value) { -- 2.39.5