From be2b3b1ec2425901c574801e39e77257c852fb1f Mon Sep 17 00:00:00 2001 From: Miltos Allamanis Date: Wed, 26 Feb 2014 14:23:33 +0000 Subject: [PATCH 1/5] Renamed "usee" to "uee". The naturalize tool detected that using "uee" is more consistent with the current codebase state: * "uee" in LocalStore is 28.47% probable ("usee" 5.01%) * "uee" in TextBody is 45.02% probable ("usee" 9.10%) --- src/com/fsck/k9/mail/internet/TextBody.java | 2 +- src/com/fsck/k9/mail/store/LocalStore.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/mail/internet/TextBody.java b/src/com/fsck/k9/mail/internet/TextBody.java index c107937f8..2d15b9ab8 100644 --- a/src/com/fsck/k9/mail/internet/TextBody.java +++ b/src/com/fsck/k9/mail/internet/TextBody.java @@ -63,7 +63,7 @@ public class TextBody implements Body { b = EMPTY_BYTE_ARRAY; } return new ByteArrayInputStream(b); - } catch (UnsupportedEncodingException usee) { + } catch (UnsupportedEncodingException uee) { return null; } } diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index c66cc5e44..2ffc8f595 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -1068,7 +1068,7 @@ public class LocalStore extends Store implements Serializable { return null; } }); - } catch (UnsupportedEncodingException usee) { + } catch (UnsupportedEncodingException uee) { throw new Error("Aparently UTF-8 has been lost to the annals of history."); } } From 2df205874e63e99978bc43b245fdf8bf58912cae Mon Sep 17 00:00:00 2001 From: Miltos Allamanis Date: Wed, 26 Feb 2014 14:27:35 +0000 Subject: [PATCH 2/5] Renamed "s" to "sizeParam". The naturalize tool detected that using "sizeParam" is more consistent with the current codebase state: * "sizeParam" in LocalStore is 22.89% probable ("s" 10.52%) --- src/com/fsck/k9/mail/store/LocalStore.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index 2ffc8f595..c1389c4ba 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -2807,10 +2807,10 @@ public class LocalStore extends Store implements Serializable { */ String disposition = attachment.getDisposition(); if (disposition != null) { - String s = MimeUtility.getHeaderParameter(disposition, "size"); - if (s != null) { + String sizeParam = MimeUtility.getHeaderParameter(disposition, "size"); + if (sizeParam != null) { try { - size = Integer.parseInt(s); + size = Integer.parseInt(sizeParam); } catch (NumberFormatException e) { /* Ignore */ } } } From 6075addfd017e9d6bf3561fd2fac6b146ce50c61 Mon Sep 17 00:00:00 2001 From: Miltos Allamanis Date: Wed, 26 Feb 2014 14:30:57 +0000 Subject: [PATCH 3/5] Renamed "local_folder" to "localFolder". The naturalize tool detected that using "localFolder" is more consistent with the current codebase state: * "localFolder" in MessageListFragment is 76.31% probable ("local_folder" 23.69%) --- src/com/fsck/k9/fragment/MessageListFragment.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/fsck/k9/fragment/MessageListFragment.java b/src/com/fsck/k9/fragment/MessageListFragment.java index fb2b6f69c..d4abd0b69 100644 --- a/src/com/fsck/k9/fragment/MessageListFragment.java +++ b/src/com/fsck/k9/fragment/MessageListFragment.java @@ -1008,17 +1008,17 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick } private FolderInfoHolder getFolder(String folder, Account account) { - LocalFolder local_folder = null; + LocalFolder localFolder = null; try { LocalStore localStore = account.getLocalStore(); - local_folder = localStore.getFolder(folder); - return new FolderInfoHolder(mContext, local_folder, account); + localFolder = localStore.getFolder(folder); + return new FolderInfoHolder(mContext, localFolder, account); } catch (Exception e) { Log.e(K9.LOG_TAG, "getFolder(" + folder + ") goes boom: ", e); return null; } finally { - if (local_folder != null) { - local_folder.close(); + if (localFolder != null) { + localFolder.close(); } } } From cfeed4078159f9712bf21658354d2bce213ad6cb Mon Sep 17 00:00:00 2001 From: Miltos Allamanis Date: Wed, 26 Feb 2014 14:42:37 +0000 Subject: [PATCH 4/5] Renamed "tokens" to "tokenizer". The naturalize tool detected that using "tokenizer" is more consistent with the current codebase state: * "tokenizer" in MessageCompose is 60.40% probable ("tokens" 39.60%) --- src/com/fsck/k9/activity/MessageCompose.java | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index eabf2a395..8c8eaa0c6 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -1737,28 +1737,28 @@ public class MessageCompose extends K9Activity implements OnClickListener, if (K9.DEBUG) Log.d(K9.LOG_TAG, "Got a saved legacy identity: " + identityString); - StringTokenizer tokens = new StringTokenizer(identityString, ":", false); + StringTokenizer tokenizer = new StringTokenizer(identityString, ":", false); // First item is the body length. We use this to separate the composed reply from the quoted text. - if (tokens.hasMoreTokens()) { - String bodyLengthS = Utility.base64Decode(tokens.nextToken()); + if (tokenizer.hasMoreTokens()) { + String bodyLengthS = Utility.base64Decode(tokenizer.nextToken()); try { identity.put(IdentityField.LENGTH, Integer.valueOf(bodyLengthS).toString()); } catch (Exception e) { Log.e(K9.LOG_TAG, "Unable to parse bodyLength '" + bodyLengthS + "'"); } } - if (tokens.hasMoreTokens()) { - identity.put(IdentityField.SIGNATURE, Utility.base64Decode(tokens.nextToken())); + if (tokenizer.hasMoreTokens()) { + identity.put(IdentityField.SIGNATURE, Utility.base64Decode(tokenizer.nextToken())); } - if (tokens.hasMoreTokens()) { - identity.put(IdentityField.NAME, Utility.base64Decode(tokens.nextToken())); + if (tokenizer.hasMoreTokens()) { + identity.put(IdentityField.NAME, Utility.base64Decode(tokenizer.nextToken())); } - if (tokens.hasMoreTokens()) { - identity.put(IdentityField.EMAIL, Utility.base64Decode(tokens.nextToken())); + if (tokenizer.hasMoreTokens()) { + identity.put(IdentityField.EMAIL, Utility.base64Decode(tokenizer.nextToken())); } - if (tokens.hasMoreTokens()) { - identity.put(IdentityField.QUOTED_TEXT_MODE, Utility.base64Decode(tokens.nextToken())); + if (tokenizer.hasMoreTokens()) { + identity.put(IdentityField.QUOTED_TEXT_MODE, Utility.base64Decode(tokenizer.nextToken())); } } From c17d0323f265041fd7a704c36c8b9be6a8e1c44a Mon Sep 17 00:00:00 2001 From: Miltos Allamanis Date: Wed, 26 Feb 2014 14:48:11 +0000 Subject: [PATCH 5/5] Renamed "identitiy" to "identity". The naturalize tool detected that using "identity" is more consistent with the current codebase state: * "identity" in SettingsImporter is 78.46% probable ("identitiy" 21.54%) --- src/com/fsck/k9/preferences/SettingsImporter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/preferences/SettingsImporter.java b/src/com/fsck/k9/preferences/SettingsImporter.java index c9fd6557c..2a774f64f 100644 --- a/src/com/fsck/k9/preferences/SettingsImporter.java +++ b/src/com/fsck/k9/preferences/SettingsImporter.java @@ -608,8 +608,8 @@ public class SettingsImporter { } private static boolean isIdentityDescriptionUsed(String description, List identities) { - for (Identity identitiy : identities) { - if (identitiy.getDescription().equals(description)) { + for (Identity identity : identities) { + if (identity.getDescription().equals(description)) { return true; } }