From 3d583da450e094115d95e09a3998b2559ebc647a Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 1 Jun 2011 16:03:56 -0400 Subject: [PATCH] ant astyle --- .../fsck/k9/activity/ActivityListener.java | 2 +- src/com/fsck/k9/activity/MessageCompose.java | 25 ++-- .../setup/AccountSetupCheckSettings.java | 120 +++++++++--------- .../activity/setup/AccountSetupOutgoing.java | 2 +- .../k9/controller/MessagingController.java | 4 +- src/com/fsck/k9/helper/FileBrowserHelper.java | 21 +-- src/com/fsck/k9/mail/store/ImapStore.java | 2 +- src/com/fsck/k9/mail/store/LocalStore.java | 76 +++++------ src/com/fsck/k9/mail/store/Pop3Store.java | 6 +- .../fsck/k9/mail/transport/SmtpTransport.java | 30 ++--- .../k9/preferences/TimePickerPreference.java | 19 ++- .../fsck/k9/provider/AttachmentProvider.java | 10 +- 12 files changed, 156 insertions(+), 161 deletions(-) diff --git a/src/com/fsck/k9/activity/ActivityListener.java b/src/com/fsck/k9/activity/ActivityListener.java index a45ac4183..803158fc0 100644 --- a/src/com/fsck/k9/activity/ActivityListener.java +++ b/src/com/fsck/k9/activity/ActivityListener.java @@ -34,7 +34,7 @@ public class ActivityListener extends MessagingListener { if (mLoadingFolderName != null || mLoadingHeaderFolderName != null) { String displayName = mLoadingFolderName; - if ((mAccount != null) && (mAccount.getInboxFolderName()!= null) && mAccount.getInboxFolderName().equalsIgnoreCase(displayName)) { + if ((mAccount != null) && (mAccount.getInboxFolderName() != null) && mAccount.getInboxFolderName().equalsIgnoreCase(displayName)) { displayName = context.getString(R.string.special_mailbox_name_inbox); } else if ((mAccount != null) && mAccount.getOutboxFolderName().equals(displayName)) { displayName = context.getString(R.string.special_mailbox_name_outbox); diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 0230c632a..17a5addf7 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -1713,22 +1713,19 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc mQuotedText.setVisibility(View.GONE); mQuotedHTML.setVisibility(View.GONE); mQuotedTextEdit.setVisibility(View.GONE); - } - else if (mQuotedTextMode == QuotedTextMode.SHOW) { + } else if (mQuotedTextMode == QuotedTextMode.SHOW) { mQuotedTextShow.setVisibility(View.GONE); mQuotedTextBar.setVisibility(View.VISIBLE); - if (mMessageFormat == MessageFormat.HTML){ + if (mMessageFormat == MessageFormat.HTML) { mQuotedText.setVisibility(View.GONE); mQuotedHTML.setVisibility(View.VISIBLE); mQuotedTextEdit.setVisibility(View.VISIBLE); - } - else { + } else { mQuotedText.setVisibility(View.VISIBLE); mQuotedHTML.setVisibility(View.GONE); mQuotedTextEdit.setVisibility(View.GONE); } - } - else if (mQuotedTextMode == QuotedTextMode.HIDE) { + } else if (mQuotedTextMode == QuotedTextMode.HIDE) { mQuotedTextShow.setVisibility(View.VISIBLE); mQuotedTextBar.setVisibility(View.GONE); @@ -2106,10 +2103,10 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc } int cursorPosition = 0; - if(k9identity.containsKey(IdentityField.CURSOR_POSITION)) { + if (k9identity.containsKey(IdentityField.CURSOR_POSITION)) { try { cursorPosition = Integer.valueOf(k9identity.get(IdentityField.CURSOR_POSITION)).intValue(); - } catch(Exception e) { + } catch (Exception e) { Log.e(K9.LOG_TAG, "Could not parse cursor position for MessageCompose; continuing.", e); } } @@ -2144,7 +2141,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc showOrHideQuotedText(QuotedTextMode.valueOf(showQuotedTextMode)); return; } - + mMessageFormat = MessageFormat.valueOf(messageFormat); if (mMessageFormat == MessageFormat.HTML) { @@ -2193,7 +2190,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc // Set the cursor position if we have it. try { mMessageContentView.setSelection(cursorPosition); - } catch(Exception e) { + } catch (Exception e) { Log.e(K9.LOG_TAG, "Could not set cursor position in MessageCompose; ignoring.", e); } @@ -2205,8 +2202,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc * the source message. Log it as an error, though. */ Log.e(K9.LOG_TAG, "Error while processing source message: ", me); - } - finally { + } finally { mSourceMessageProcessed = true; mDraftNeedsSaving = false; } @@ -2236,8 +2232,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc if (shown) { showOrHideQuotedText(QuotedTextMode.SHOW); - } - else { + } else { showOrHideQuotedText(QuotedTextMode.HIDE); } } diff --git a/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java b/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java index eda175696..dea937eaa 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java @@ -252,7 +252,7 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList } for (int i = 0; i < chain.length; i++) { // display certificate chain information - //TODO: localize this strings + //TODO: localize this strings chainInfo.append("Certificate chain[" + i + "]:\n"); chainInfo.append("Subject: " + chain[i].getSubjectDN().toString() + "\n"); @@ -261,68 +261,68 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList // by a subjectDN not matching the server even though a // SubjectAltName matches) try { - final Collection> subjectAlternativeNames = chain[i].getSubjectAlternativeNames(); - if (subjectAlternativeNames != null) { - // The list of SubjectAltNames may be very long - //TODO: localize this string - StringBuffer altNamesText = new StringBuffer("Subject has " + subjectAlternativeNames.size() + " alternative names\n"); + final Collection < List> subjectAlternativeNames = chain[i].getSubjectAlternativeNames(); + if (subjectAlternativeNames != null) { + // The list of SubjectAltNames may be very long + //TODO: localize this string + StringBuffer altNamesText = new StringBuffer("Subject has " + subjectAlternativeNames.size() + " alternative names\n"); - // we need these for matching - String storeURIHost = (Uri.parse(mAccount.getStoreUri())).getHost(); - String transportURIHost = (Uri.parse(mAccount.getTransportUri())).getHost(); + // we need these for matching + String storeURIHost = (Uri.parse(mAccount.getStoreUri())).getHost(); + String transportURIHost = (Uri.parse(mAccount.getTransportUri())).getHost(); - for (List subjectAlternativeName : subjectAlternativeNames) { - Integer type = (Integer)subjectAlternativeName.get(0); - Object value = subjectAlternativeName.get(1); - String name = ""; - switch (type.intValue()) { - case 0: - Log.w(K9.LOG_TAG, "SubjectAltName of type OtherName not supported."); - continue; - case 1: // RFC822Name - name = (String)value; - break; - case 2: // DNSName - name = (String)value; - break; - case 3: - Log.w(K9.LOG_TAG, "unsupported SubjectAltName of type x400Address"); - continue; - case 4: - Log.w(K9.LOG_TAG, "unsupported SubjectAltName of type directoryName"); - continue; - case 5: - Log.w(K9.LOG_TAG, "unsupported SubjectAltName of type ediPartyName"); - continue; - case 6: // Uri - name = (String)value; - break; - case 7: // ip-address - name = (String)value; - break; - default: - Log.w(K9.LOG_TAG, "unsupported SubjectAltName of unknown type"); - continue; - } + for (List subjectAlternativeName : subjectAlternativeNames) { + Integer type = (Integer)subjectAlternativeName.get(0); + Object value = subjectAlternativeName.get(1); + String name = ""; + switch (type.intValue()) { + case 0: + Log.w(K9.LOG_TAG, "SubjectAltName of type OtherName not supported."); + continue; + case 1: // RFC822Name + name = (String)value; + break; + case 2: // DNSName + name = (String)value; + break; + case 3: + Log.w(K9.LOG_TAG, "unsupported SubjectAltName of type x400Address"); + continue; + case 4: + Log.w(K9.LOG_TAG, "unsupported SubjectAltName of type directoryName"); + continue; + case 5: + Log.w(K9.LOG_TAG, "unsupported SubjectAltName of type ediPartyName"); + continue; + case 6: // Uri + name = (String)value; + break; + case 7: // ip-address + name = (String)value; + break; + default: + Log.w(K9.LOG_TAG, "unsupported SubjectAltName of unknown type"); + continue; + } - // if some of the SubjectAltNames match the store or transport -host, - // display them - if (name.equalsIgnoreCase(storeURIHost) || name.equalsIgnoreCase(transportURIHost)) { - //TODO: localize this string - altNamesText.append("Subject(alt): " + name + ",...\n"); - } else if (name.startsWith("*.")) { - if (storeURIHost.endsWith(name.substring(2)) || transportURIHost.endsWith(name.substring(2))) { - //TODO: localize this string - altNamesText.append("Subject(alt): " + name + ",...\n"); - } - } - } - chainInfo.append(altNamesText); - } - } catch (Exception e1) { - // don't fail just because of subjectAltNames - Log.w(K9.LOG_TAG, "cannot display SubjectAltNames in dialog", e1); - } + // if some of the SubjectAltNames match the store or transport -host, + // display them + if (name.equalsIgnoreCase(storeURIHost) || name.equalsIgnoreCase(transportURIHost)) { + //TODO: localize this string + altNamesText.append("Subject(alt): " + name + ",...\n"); + } else if (name.startsWith("*.")) { + if (storeURIHost.endsWith(name.substring(2)) || transportURIHost.endsWith(name.substring(2))) { + //TODO: localize this string + altNamesText.append("Subject(alt): " + name + ",...\n"); + } + } + } + chainInfo.append(altNamesText); + } + } catch (Exception e1) { + // don't fail just because of subjectAltNames + Log.w(K9.LOG_TAG, "cannot display SubjectAltNames in dialog", e1); + } chainInfo.append("Issuer: " + chain[i].getIssuerDN().toString() + "\n"); if (sha1 != null) { diff --git a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java index 3a3938d09..73738fe3f 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java @@ -53,7 +53,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, SmtpTransport.AUTH_PLAIN, SmtpTransport.AUTH_CRAM_MD5, }; - + private EditText mUsernameView; private EditText mPasswordView; private EditText mServerView; diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index f8cd2167f..079b72812 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -3930,7 +3930,7 @@ public class MessagingController implements Runnable { if (messageUid <= localFolder.getLastUid()) { if (K9.DEBUG) Log.d(K9.LOG_TAG, "Message uid is " + messageUid + ", max message uid is " + - localFolder.getLastUid() + ". Skipping notification."); + localFolder.getLastUid() + ". Skipping notification."); return false; } } catch (NumberFormatException e) { @@ -3953,7 +3953,7 @@ public class MessagingController implements Runnable { * Creates a notification of a newly received message. */ private void notifyAccount(Context context, Account account, Message message, - int previousUnreadMessageCount, AtomicInteger newMessageCount) { + int previousUnreadMessageCount, AtomicInteger newMessageCount) { // If we have a message, set the notification to ": " StringBuilder messageNotice = new StringBuilder(); diff --git a/src/com/fsck/k9/helper/FileBrowserHelper.java b/src/com/fsck/k9/helper/FileBrowserHelper.java index 3c8634c57..ad8d5bfb1 100644 --- a/src/com/fsck/k9/helper/FileBrowserHelper.java +++ b/src/com/fsck/k9/helper/FileBrowserHelper.java @@ -19,11 +19,12 @@ public class FileBrowserHelper { * A string array that specifies the name of the intent to use, and the scheme to use with it * when setting the data for the intent. */ - private static final String[][] PICK_DIRECTORY_INTENTS = - { { "org.openintents.action.PICK_DIRECTORY", "file://" }, // OI File Manager (maybe others) - { "com.estrongs.action.PICK_DIRECTORY", "file://" }, // ES File Explorer - { Intent.ACTION_PICK, "folder://" }, // Blackmoon File Browser (maybe others) - { "com.androidworkz.action.PICK_DIRECTORY", "file://" }}; // SystemExplorer + private static final String[][] PICK_DIRECTORY_INTENTS = { + { "org.openintents.action.PICK_DIRECTORY", "file://" }, // OI File Manager (maybe others) + { "com.estrongs.action.PICK_DIRECTORY", "file://" }, // ES File Explorer + { Intent.ACTION_PICK, "folder://" }, // Blackmoon File Browser (maybe others) + { "com.androidworkz.action.PICK_DIRECTORY", "file://" } + }; // SystemExplorer private static FileBrowserHelper sInstance; @@ -82,15 +83,15 @@ public class FileBrowserHelper { do { String intentAction = PICK_DIRECTORY_INTENTS[listIndex][0]; String uriPrefix = PICK_DIRECTORY_INTENTS[listIndex][1]; - Intent intent = new Intent(intentAction); - intent.setData(Uri.parse(uriPrefix + startPath.getPath())); + Intent intent = new Intent(intentAction); + intent.setData(Uri.parse(uriPrefix + startPath.getPath())); - try { + try { c.startActivityForResult(intent, requestcode); success = true; } catch (ActivityNotFoundException e) { - // Try the next intent in the list - listIndex++; + // Try the next intent in the list + listIndex++; }; } while (!success && (listIndex < PICK_DIRECTORY_INTENTS.length)); diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index 92d0cb778..b639a11f2 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -382,7 +382,7 @@ public class ImapStore extends Store { decodedFolderName = decodeFolderName(response.getString(3)); } catch (CharacterCodingException e) { Log.w(K9.LOG_TAG, "Folder name not correctly encoded with the UTF-7 variant " + - "as defined by RFC 3501: " + response.getString(3), e); + "as defined by RFC 3501: " + response.getString(3), e); //TODO: Use the raw name returned by the server for all commands that require // a folder name. Use the decoded name only for showing it to the user. diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index 52d28b8d7..fba282164 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -505,53 +505,53 @@ public class LocalStore extends Store implements Serializable { // Always count messages in the INBOX but exclude special folders and possibly // more (depending on the folder display mode) String baseQuery = "SELECT SUM(unread_count), SUM(flagged_count) " + - "FROM folders " + - "WHERE (name = ?)" + /* INBOX */ - " OR (" + - "name NOT IN (?, ?, ?, ?, ?)" + /* special folders */ - "%s)"; /* placeholder for additional constraints */ + "FROM folders " + + "WHERE (name = ?)" + /* INBOX */ + " OR (" + + "name NOT IN (?, ?, ?, ?, ?)" + /* special folders */ + "%s)"; /* placeholder for additional constraints */ List queryParam = new ArrayList(); queryParam.add(mAccount.getInboxFolderName()); queryParam.add((mAccount.getTrashFolderName() != null) ? - mAccount.getTrashFolderName() : ""); + mAccount.getTrashFolderName() : ""); queryParam.add((mAccount.getDraftsFolderName() != null) ? - mAccount.getDraftsFolderName() : ""); + mAccount.getDraftsFolderName() : ""); queryParam.add((mAccount.getSpamFolderName() != null) ? - mAccount.getSpamFolderName() : ""); + mAccount.getSpamFolderName() : ""); queryParam.add((mAccount.getOutboxFolderName() != null) ? - mAccount.getOutboxFolderName() : ""); + mAccount.getOutboxFolderName() : ""); queryParam.add((mAccount.getSentFolderName() != null) ? - mAccount.getSentFolderName() : ""); + mAccount.getSentFolderName() : ""); final String extraWhere; switch (displayMode) { - case FIRST_CLASS: - // Count messages in the INBOX and non-special first class folders - extraWhere = " AND (display_class = ?)"; - queryParam.add(Folder.FolderClass.FIRST_CLASS.name()); - break; - case FIRST_AND_SECOND_CLASS: - // Count messages in the INBOX and non-special first and second class folders - extraWhere = " AND (display_class IN (?, ?))"; - queryParam.add(Folder.FolderClass.FIRST_CLASS.name()); - queryParam.add(Folder.FolderClass.SECOND_CLASS.name()); - break; - case NOT_SECOND_CLASS: - // Count messages in the INBOX and non-special non-second-class folders - extraWhere = " AND (display_class != ?)"; - queryParam.add(Folder.FolderClass.SECOND_CLASS.name()); - break; - case ALL: - // Count messages in the INBOX and non-special folders - extraWhere = ""; - break; - default: - Log.e(K9.LOG_TAG, "asked to compute account statistics for an impossible folder mode " + displayMode); - stats.unreadMessageCount = 0; - stats.flaggedMessageCount = 0; - return null; + case FIRST_CLASS: + // Count messages in the INBOX and non-special first class folders + extraWhere = " AND (display_class = ?)"; + queryParam.add(Folder.FolderClass.FIRST_CLASS.name()); + break; + case FIRST_AND_SECOND_CLASS: + // Count messages in the INBOX and non-special first and second class folders + extraWhere = " AND (display_class IN (?, ?))"; + queryParam.add(Folder.FolderClass.FIRST_CLASS.name()); + queryParam.add(Folder.FolderClass.SECOND_CLASS.name()); + break; + case NOT_SECOND_CLASS: + // Count messages in the INBOX and non-special non-second-class folders + extraWhere = " AND (display_class != ?)"; + queryParam.add(Folder.FolderClass.SECOND_CLASS.name()); + break; + case ALL: + // Count messages in the INBOX and non-special folders + extraWhere = ""; + break; + default: + Log.e(K9.LOG_TAG, "asked to compute account statistics for an impossible folder mode " + displayMode); + stats.unreadMessageCount = 0; + stats.flaggedMessageCount = 0; + return null; } String query = String.format(Locale.US, baseQuery, extraWhere); @@ -1671,7 +1671,7 @@ public class LocalStore extends Store implements Serializable { bp.setHeader(MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING, "base64"); if (name != null) { String encoded_name = EncoderUtil.encodeIfNecessary(name, - EncoderUtil.Usage.WORD_ENTITY, 7); + EncoderUtil.Usage.WORD_ENTITY, 7); bp.setHeader(MimeHeader.HEADER_CONTENT_TYPE, String.format("%s;\n name=\"%s\"", @@ -2444,8 +2444,8 @@ public class LocalStore extends Store implements Serializable { if (htmlContent != null) { String newHtmlContent = htmlContent.replaceAll( - Pattern.quote("cid:" + contentId), - contentUri.toString()); + Pattern.quote("cid:" + contentId), + contentUri.toString()); ContentValues cv = new ContentValues(); cv.put("html_content", newHtmlContent); diff --git a/src/com/fsck/k9/mail/store/Pop3Store.java b/src/com/fsck/k9/mail/store/Pop3Store.java index ee04f15d8..a307c8484 100644 --- a/src/com/fsck/k9/mail/store/Pop3Store.java +++ b/src/com/fsck/k9/mail/store/Pop3Store.java @@ -681,11 +681,11 @@ public class Pop3Store extends Store { try { if (K9.DEBUG && K9.DEBUG_PROTOCOL_POP3 && !mCapabilities.top) { Log.d(K9.LOG_TAG, "This server doesn't support the CAPA command. " + - "Checking to see if the TOP command is supported nevertheless."); + "Checking to see if the TOP command is supported nevertheless."); } response = executeSimpleCommand(String.format("TOP %d %d", - mUidToMsgNumMap.get(message.getUid()), lines)); + mUidToMsgNumMap.get(message.getUid()), lines)); // TOP command is supported. Remember this for the next time. mCapabilities.top = true; @@ -696,7 +696,7 @@ public class Pop3Store extends Store { } else { if (K9.DEBUG && K9.DEBUG_PROTOCOL_POP3) { Log.d(K9.LOG_TAG, "The server really doesn't support the TOP " + - "command. Using RETR instead."); + "command. Using RETR instead."); } // Don't try to use the TOP command again. diff --git a/src/com/fsck/k9/mail/transport/SmtpTransport.java b/src/com/fsck/k9/mail/transport/SmtpTransport.java index de204a1dd..39f483342 100644 --- a/src/com/fsck/k9/mail/transport/SmtpTransport.java +++ b/src/com/fsck/k9/mail/transport/SmtpTransport.java @@ -265,17 +265,17 @@ public class SmtpTransport extends Transport { if (useAuthCramMD5 || (useAutomaticAuth && authCramMD5Supported)) { if (!authCramMD5Supported && K9.DEBUG && K9.DEBUG_PROTOCOL_SMTP) { Log.d(K9.LOG_TAG, "Using CRAM_MD5 as authentication method although the " + - "server didn't advertise support for it in EHLO response."); + "server didn't advertise support for it in EHLO response."); } saslAuthCramMD5(mUsername, mPassword); } else if (useAuthPlain || (useAutomaticAuth && authPlainSupported)) { if (!authPlainSupported && K9.DEBUG && K9.DEBUG_PROTOCOL_SMTP) { Log.d(K9.LOG_TAG, "Using PLAIN as authentication method although the " + - "server didn't advertise support for it in EHLO response."); + "server didn't advertise support for it in EHLO response."); } try { saslAuthPlain(mUsername, mPassword); - } catch(MessagingException ex) { + } catch (MessagingException ex) { // PLAIN is a special case. Historically, PLAIN has represented both PLAIN and LOGIN; only the // protocol being advertised by the server would be used, with PLAIN taking precedence. Instead // of using only the requested protocol, we'll try PLAIN and then try LOGIN. @@ -292,7 +292,7 @@ public class SmtpTransport extends Transport { } else if (useAuthLogin || (useAutomaticAuth && authLoginSupported)) { if (!authPlainSupported && K9.DEBUG && K9.DEBUG_PROTOCOL_SMTP) { Log.d(K9.LOG_TAG, "Using LOGIN as authentication method although the " + - "server didn't advertise support for it in EHLO response."); + "server didn't advertise support for it in EHLO response."); } saslAuthLogin(mUsername, mPassword); } else { @@ -352,20 +352,20 @@ public class SmtpTransport extends Transport { // If the message has attachments and our server has told us about a limit on // the size of messages, count the message's size before sending it if (mLargestAcceptableMessage > 0 && ((LocalMessage)message).hasAttachments()) { - if (K9.DEBUG_PROTOCOL_SMTP) { - Log.d(K9.LOG_TAG, "calculating message size"); - } - close(); // (prevent timeouts while calculating the size) + if (K9.DEBUG_PROTOCOL_SMTP) { + Log.d(K9.LOG_TAG, "calculating message size"); + } + close(); // (prevent timeouts while calculating the size) final long calculatedSize = message.calculateSize(); - if (calculatedSize > mLargestAcceptableMessage) { + if (calculatedSize > mLargestAcceptableMessage) { MessagingException me = new MessagingException("Message too large for server"); me.setPermanentFailure(possibleSend); throw me; } - open(); // (prevent timeouts while calculating the size) - if (K9.DEBUG_PROTOCOL_SMTP) { - Log.d(K9.LOG_TAG, "calculating message size DONE size=" + calculatedSize + " max allowed=" + mLargestAcceptableMessage); - } + open(); // (prevent timeouts while calculating the size) + if (K9.DEBUG_PROTOCOL_SMTP) { + Log.d(K9.LOG_TAG, "calculating message size DONE size=" + calculatedSize + " max allowed=" + mLargestAcceptableMessage); + } } Address[] from = message.getFrom(); @@ -396,8 +396,8 @@ public class SmtpTransport extends Transport { // "5xx text" -responses are permanent failures String msg = e.getMessage(); if (msg != null && msg.startsWith("5")) { - Log.w(K9.LOG_TAG, "handling 5xx SMTP error code as a permanent failure"); - possibleSend=false; + Log.w(K9.LOG_TAG, "handling 5xx SMTP error code as a permanent failure"); + possibleSend = false; } me.setPermanentFailure(possibleSend); diff --git a/src/com/fsck/k9/preferences/TimePickerPreference.java b/src/com/fsck/k9/preferences/TimePickerPreference.java index cc021f8d8..f829cebfc 100644 --- a/src/com/fsck/k9/preferences/TimePickerPreference.java +++ b/src/com/fsck/k9/preferences/TimePickerPreference.java @@ -53,7 +53,7 @@ public class TimePickerPreference extends DialogPreference implements * @param defStyle */ public TimePickerPreference(final Context context, final AttributeSet attrs, - final int defStyle) { + final int defStyle) { super(context, attrs, defStyle); initialize(); } @@ -78,8 +78,7 @@ public class TimePickerPreference extends DialogPreference implements tp.setOnTimeChangedListener(this); originalHour = getHour(); originalMinute = getMinute(); - if (originalHour >= 0 && originalMinute >= 0) - { + if (originalHour >= 0 && originalMinute >= 0) { tp.setCurrentHour(originalHour); tp.setCurrentMinute(originalMinute); } @@ -104,14 +103,14 @@ public class TimePickerPreference extends DialogPreference implements * before going to super.onDialogClosed(positiveResult). */ @Override - protected void onDialogClosed(boolean positiveResult) { + protected void onDialogClosed(boolean positiveResult) { - if (!positiveResult) { - persistString(String.format("%02d:%02d", originalHour, originalMinute)); - callChangeListener(String.format("%02d:%02d", originalHour, originalMinute)); - } - super.onDialogClosed(positiveResult); - } + if (!positiveResult) { + persistString(String.format("%02d:%02d", originalHour, originalMinute)); + callChangeListener(String.format("%02d:%02d", originalHour, originalMinute)); + } + super.onDialogClosed(positiveResult); + } /** * @see android.preference.Preference#setDefaultValue(java.lang.Object) diff --git a/src/com/fsck/k9/provider/AttachmentProvider.java b/src/com/fsck/k9/provider/AttachmentProvider.java index 8b234113b..ef41f420d 100644 --- a/src/com/fsck/k9/provider/AttachmentProvider.java +++ b/src/com/fsck/k9/provider/AttachmentProvider.java @@ -74,12 +74,12 @@ public class AttachmentProvider extends ContentProvider { */ final File cacheDir = getContext().getCacheDir(); if (cacheDir == null) { - return true; + return true; + } + File[] files = cacheDir.listFiles(); + if (files == null) { + return true; } - File[] files = cacheDir.listFiles(); - if (files == null) { - return true; - } for (File file : files) { if (file.getName().endsWith(".tmp")) { file.delete();