From 6804ee04e3cef6e5576c3ac7abf6f7860d0908dc Mon Sep 17 00:00:00 2001 From: cketti Date: Sat, 3 Jan 2015 03:46:19 +0100 Subject: [PATCH] Fix some MS_SHOULD_BE_FINAL Findbugs warnings --- k9mail/src/main/java/com/fsck/k9/K9.java | 6 +++--- .../src/main/java/com/fsck/k9/crypto/CryptoHelper.java | 4 ++-- .../com/fsck/k9/remotecontrol/K9RemoteControl.java | 2 +- .../main/java/com/fsck/k9/service/BootReceiver.java | 10 +++++----- .../main/java/com/fsck/k9/service/CoreReceiver.java | 4 ++-- .../src/main/java/com/fsck/k9/service/CoreService.java | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/k9mail/src/main/java/com/fsck/k9/K9.java b/k9mail/src/main/java/com/fsck/k9/K9.java index 3b43f39b9..7789e6608 100644 --- a/k9mail/src/main/java/com/fsck/k9/K9.java +++ b/k9mail/src/main/java/com/fsck/k9/K9.java @@ -149,7 +149,7 @@ public class K9 extends Application { * * Feature is enabled when DEBUG == true */ - public static String ERROR_FOLDER_NAME = "K9mail-errors"; + public static final String ERROR_FOLDER_NAME = "K9mail-errors"; /** * A reference to the {@link SharedPreferences} used for caching the last known database @@ -280,7 +280,7 @@ public class K9 extends Application { * on each new folder and can be incremented with "Load more messages..." by the * VISIBLE_LIMIT_INCREMENT */ - public static int DEFAULT_VISIBLE_LIMIT = 25; + public static final int DEFAULT_VISIBLE_LIMIT = 25; /** * The maximum size of an attachment we're willing to download (either View or Save) @@ -295,7 +295,7 @@ public class K9 extends Application { * until the app is killed and restarted */ - public static int MAX_SEND_ATTEMPTS = 5; + public static final int MAX_SEND_ATTEMPTS = 5; /** * Max time (in millis) the wake lock will be held for when background sync is happening diff --git a/k9mail/src/main/java/com/fsck/k9/crypto/CryptoHelper.java b/k9mail/src/main/java/com/fsck/k9/crypto/CryptoHelper.java index 612c4ba3d..f12b7c806 100644 --- a/k9mail/src/main/java/com/fsck/k9/crypto/CryptoHelper.java +++ b/k9mail/src/main/java/com/fsck/k9/crypto/CryptoHelper.java @@ -13,11 +13,11 @@ import com.fsck.k9.mail.internet.MimeUtility; public class CryptoHelper { - public static Pattern PGP_MESSAGE = + public static final Pattern PGP_MESSAGE = Pattern.compile(".*?(-----BEGIN PGP MESSAGE-----.*?-----END PGP MESSAGE-----).*", Pattern.DOTALL); - public static Pattern PGP_SIGNED_MESSAGE = + public static final Pattern PGP_SIGNED_MESSAGE = Pattern.compile( ".*?(-----BEGIN PGP SIGNED MESSAGE-----.*?-----BEGIN PGP SIGNATURE-----.*?-----END PGP SIGNATURE-----).*", Pattern.DOTALL); diff --git a/k9mail/src/main/java/com/fsck/k9/remotecontrol/K9RemoteControl.java b/k9mail/src/main/java/com/fsck/k9/remotecontrol/K9RemoteControl.java index 279331988..754ba8e25 100644 --- a/k9mail/src/main/java/com/fsck/k9/remotecontrol/K9RemoteControl.java +++ b/k9mail/src/main/java/com/fsck/k9/remotecontrol/K9RemoteControl.java @@ -115,7 +115,7 @@ public class K9RemoteControl { public final static String K9_THEME_LIGHT = "LIGHT"; public final static String K9_THEME_DARK = "DARK"; - protected static String LOG_TAG = "K9RemoteControl"; + protected static final String LOG_TAG = "K9RemoteControl"; public static void set(Context context, Intent broadcastIntent) { broadcastIntent.setAction(K9RemoteControl.K9_SET); diff --git a/k9mail/src/main/java/com/fsck/k9/service/BootReceiver.java b/k9mail/src/main/java/com/fsck/k9/service/BootReceiver.java index 6ef20f1fe..dec7cb1ef 100644 --- a/k9mail/src/main/java/com/fsck/k9/service/BootReceiver.java +++ b/k9mail/src/main/java/com/fsck/k9/service/BootReceiver.java @@ -15,12 +15,12 @@ import com.fsck.k9.K9; public class BootReceiver extends CoreReceiver { - public static String FIRE_INTENT = "com.fsck.k9.service.BroadcastReceiver.fireIntent"; - public static String SCHEDULE_INTENT = "com.fsck.k9.service.BroadcastReceiver.scheduleIntent"; - public static String CANCEL_INTENT = "com.fsck.k9.service.BroadcastReceiver.cancelIntent"; + public static final String FIRE_INTENT = "com.fsck.k9.service.BroadcastReceiver.fireIntent"; + public static final String SCHEDULE_INTENT = "com.fsck.k9.service.BroadcastReceiver.scheduleIntent"; + public static final String CANCEL_INTENT = "com.fsck.k9.service.BroadcastReceiver.cancelIntent"; - public static String ALARMED_INTENT = "com.fsck.k9.service.BroadcastReceiver.pendingIntent"; - public static String AT_TIME = "com.fsck.k9.service.BroadcastReceiver.atTime"; + public static final String ALARMED_INTENT = "com.fsck.k9.service.BroadcastReceiver.pendingIntent"; + public static final String AT_TIME = "com.fsck.k9.service.BroadcastReceiver.atTime"; @Override public Integer receive(Context context, Intent intent, Integer tmpWakeLockId) { diff --git a/k9mail/src/main/java/com/fsck/k9/service/CoreReceiver.java b/k9mail/src/main/java/com/fsck/k9/service/CoreReceiver.java index ca949f82e..50b899f2f 100644 --- a/k9mail/src/main/java/com/fsck/k9/service/CoreReceiver.java +++ b/k9mail/src/main/java/com/fsck/k9/service/CoreReceiver.java @@ -16,9 +16,9 @@ import com.fsck.k9.mail.power.TracingPowerManager.TracingWakeLock; public class CoreReceiver extends BroadcastReceiver { - public static String WAKE_LOCK_RELEASE = "com.fsck.k9.service.CoreReceiver.wakeLockRelease"; + public static final String WAKE_LOCK_RELEASE = "com.fsck.k9.service.CoreReceiver.wakeLockRelease"; - public static String WAKE_LOCK_ID = "com.fsck.k9.service.CoreReceiver.wakeLockId"; + public static final String WAKE_LOCK_ID = "com.fsck.k9.service.CoreReceiver.wakeLockId"; private static ConcurrentHashMap wakeLocks = new ConcurrentHashMap(); private static AtomicInteger wakeLockSeq = new AtomicInteger(0); diff --git a/k9mail/src/main/java/com/fsck/k9/service/CoreService.java b/k9mail/src/main/java/com/fsck/k9/service/CoreService.java index 2696b55df..0ed8a496c 100644 --- a/k9mail/src/main/java/com/fsck/k9/service/CoreService.java +++ b/k9mail/src/main/java/com/fsck/k9/service/CoreService.java @@ -57,7 +57,7 @@ import com.fsck.k9.mail.power.TracingPowerManager.TracingWakeLock; */ public abstract class CoreService extends Service { - public static String WAKE_LOCK_ID = "com.fsck.k9.service.CoreService.wakeLockId"; + public static final String WAKE_LOCK_ID = "com.fsck.k9.service.CoreService.wakeLockId"; private static ConcurrentHashMap sWakeLocks = new ConcurrentHashMap();