diff --git a/src/com/fsck/k9/Account.java b/src/com/fsck/k9/Account.java index 848d540b3..5116beb09 100644 --- a/src/com/fsck/k9/Account.java +++ b/src/com/fsck/k9/Account.java @@ -326,7 +326,7 @@ public class Account implements BaseAccount mNotificationSetting.setVibrateTimes(prefs.getInt(mUuid + ".vibrateTimes", 5)); mNotificationSetting.setRing(prefs.getBoolean(mUuid + ".ring", true)); mNotificationSetting.setRingtone(prefs.getString(mUuid + ".ringtone", - "content://settings/system/notification_sound")); + "content://settings/system/notification_sound")); mNotificationSetting.setLed(prefs.getBoolean(mUuid + ".led", true)); mNotificationSetting.setLedColor(prefs.getInt(mUuid+".ledColor", mChipColor)); diff --git a/src/com/fsck/k9/K9.java b/src/com/fsck/k9/K9.java index b8cba28c0..919bfac6b 100644 --- a/src/com/fsck/k9/K9.java +++ b/src/com/fsck/k9/K9.java @@ -40,7 +40,7 @@ public class K9 extends Application { /** * Called when the Application instance is available and ready. - * + * * @param application * The application instance. Never null. * @throws Exception @@ -55,7 +55,7 @@ public class K9 extends Application /** * Components that are interested in knowing when the K9 instance is * available and ready. - * + * * @see ApplicationAware */ private static List observers = new ArrayList(); @@ -547,7 +547,7 @@ public class K9 extends Application /** * Register a component to be notified when the {@link K9} instance is ready. - * + * * @param component * Never null. */ @@ -695,11 +695,13 @@ public class K9 extends Application mChangeRegisteredNameColor = checkboxes; } - public static int getRegisteredNameColor() { + public static int getRegisteredNameColor() + { return mRegisteredNameColor; } - public static void setRegisteredNameColor(int registeredNameColor) { + public static void setRegisteredNameColor(int registeredNameColor) + { mRegisteredNameColor = registeredNameColor; } diff --git a/src/com/fsck/k9/NotificationSetting.java b/src/com/fsck/k9/NotificationSetting.java index 434865873..737ae5ce2 100644 --- a/src/com/fsck/k9/NotificationSetting.java +++ b/src/com/fsck/k9/NotificationSetting.java @@ -33,7 +33,7 @@ public class NotificationSetting /** * Set the ringtone kill switch. Allow to disable ringtone without losing * ringtone selection. - * + * * @param ring * true to allow ringtones, false * otherwise. diff --git a/src/com/fsck/k9/activity/K9ListActivity.java b/src/com/fsck/k9/activity/K9ListActivity.java index 0b446d187..eebee30b8 100644 --- a/src/com/fsck/k9/activity/K9ListActivity.java +++ b/src/com/fsck/k9/activity/K9ListActivity.java @@ -79,7 +79,7 @@ public class K9ListActivity extends ListActivity { currentPosition = listView.getFirstVisiblePosition(); } - + if (currentPosition < listView.getCount()) { listView.setSelection(currentPosition + 1); diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 83f6ed528..070a4b06e 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -1022,7 +1022,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc bp.addHeader(MimeHeader.HEADER_CONTENT_TYPE, String.format("%s;\n name=\"%s\"", attachment.contentType, EncoderUtil.encodeIfNecessary(attachment.name, - EncoderUtil.Usage.WORD_ENTITY, 7))); + EncoderUtil.Usage.WORD_ENTITY, 7))); bp.addHeader(MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING, "base64"); @@ -1874,37 +1874,40 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc if (quotedText == null) { part = MimeUtility.findFirstPartByMimeType(message, "text/plain"); - if (part != null) { + if (part != null) + { quotedText = MimeUtility.getTextFromPart(part); } } if (quotedText == null) { part = MimeUtility.findFirstPartByMimeType(message, "text/html"); - if (part != null) { + if (part != null) + { quotedText = (Html.fromHtml(MimeUtility.getTextFromPart(part))).toString(); - } + } } + if (quotedText != null) + { + String text = String.format( + getString(R.string.message_compose_fwd_header_fmt), + mSourceMessage.getSubject(), + Address.toString(mSourceMessage.getFrom()), + Address.toString( + mSourceMessage.getRecipients(RecipientType.TO)), + Address.toString( + mSourceMessage.getRecipients(RecipientType.CC))); if (quotedText != null) { - String text = String.format( - getString(R.string.message_compose_fwd_header_fmt), - mSourceMessage.getSubject(), - Address.toString(mSourceMessage.getFrom()), - Address.toString( - mSourceMessage.getRecipients(RecipientType.TO)), - Address.toString( - mSourceMessage.getRecipients(RecipientType.CC))); - if (quotedText != null) { quotedText = quotedText.replaceAll("\\\r", ""); mQuotedText.setText(text); mQuotedText.append(quotedText); - } - mQuotedTextBar.setVisibility(View.VISIBLE); - mQuotedText.setVisibility(View.VISIBLE); + } + mQuotedTextBar.setVisibility(View.VISIBLE); + mQuotedText.setVisibility(View.VISIBLE); } if (!mSourceMessageProcessed) { diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index bdd6b38a7..8a95b09ab 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -74,8 +74,8 @@ import com.fsck.k9.mail.store.LocalStore.LocalFolder; * From this Activity the user can perform all standard message operations. */ public class MessageList - extends K9Activity - implements OnClickListener, AdapterView.OnItemClickListener + extends K9Activity + implements OnClickListener, AdapterView.OnItemClickListener { /** @@ -318,7 +318,8 @@ public class MessageList private Context context = null; - /* package visibility for faster inner class access */ MessageHelper mMessageHelper = MessageHelper.getInstance(this); + /* package visibility for faster inner class access */ + MessageHelper mMessageHelper = MessageHelper.getInstance(this); class MessageListHandler { @@ -1883,7 +1884,7 @@ public class MessageList return true; float deltaX = e2.getX() - e1.getX(), - deltaY = e2.getY() - e1.getY(); + deltaY = e2.getY() - e1.getY(); boolean movedAcross = (Math.abs(deltaX) > Math.abs(deltaY * 4)); boolean steadyHand = (Math.abs(deltaX / deltaY) > 2); @@ -2746,7 +2747,7 @@ public class MessageList } class MessageViewHolder - implements OnCheckedChangeListener + implements OnCheckedChangeListener { public TextView subject; public TextView preview; diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index 405dbd645..4fae5910f 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -1319,24 +1319,24 @@ public class MessageView extends K9Activity implements OnClickListener builder.setTitle(R.string.dialog_confirm_delete_title); builder.setMessage(R.string.dialog_confirm_delete_message); builder.setPositiveButton(R.string.dialog_confirm_delete_confirm_button, - new DialogInterface.OnClickListener() - { - @Override - public void onClick(DialogInterface dialog, int which) - { - dismissDialog(id); - delete(); - } - }); + new DialogInterface.OnClickListener() + { + @Override + public void onClick(DialogInterface dialog, int which) + { + dismissDialog(id); + delete(); + } + }); builder.setNegativeButton(R.string.dialog_confirm_delete_cancel_button, - new DialogInterface.OnClickListener() - { - @Override - public void onClick(DialogInterface dialog, int which) - { - dismissDialog(id); - } - }); + new DialogInterface.OnClickListener() + { + @Override + public void onClick(DialogInterface dialog, int which) + { + dismissDialog(id); + } + }); final AlertDialog dialog = builder.create(); return dialog; } diff --git a/src/com/fsck/k9/activity/setup/AccountSetupBasics.java b/src/com/fsck/k9/activity/setup/AccountSetupBasics.java index 4df1917fc..70b7312a5 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupBasics.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupBasics.java @@ -35,7 +35,7 @@ import java.net.URLEncoder; * AccountSetupAccountType activity. */ public class AccountSetupBasics extends K9Activity - implements OnClickListener, TextWatcher + implements OnClickListener, TextWatcher { private final static String EXTRA_ACCOUNT = "com.fsck.k9.AccountSetupBasics.account"; private final static int DIALOG_NOTE = 1; diff --git a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java index 0aed92d60..d235ff902 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java @@ -23,7 +23,7 @@ import java.net.URLDecoder; import java.net.URLEncoder; public class AccountSetupOutgoing extends K9Activity implements OnClickListener, - OnCheckedChangeListener + OnCheckedChangeListener { private static final String EXTRA_ACCOUNT = "account"; diff --git a/src/com/fsck/k9/activity/setup/Prefs.java b/src/com/fsck/k9/activity/setup/Prefs.java index 1d99c0828..72ebd62d3 100644 --- a/src/com/fsck/k9/activity/setup/Prefs.java +++ b/src/com/fsck/k9/activity/setup/Prefs.java @@ -243,11 +243,13 @@ public class Prefs extends K9PreferenceActivity { public boolean onPreferenceChange(Preference preference, Object newValue) { - if ((boolean)(Boolean)newValue == true) { + if ((boolean)(Boolean)newValue == true) + { onChooseRegisteredNameColor(); mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_changed); } - else { + else + { mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_default); } mChangeRegisteredNameColor.setChecked((Boolean)newValue); diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index d8b03523f..78d2ab54e 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -4584,7 +4584,7 @@ public class MessagingController implements Runnable { subject = context.getString(R.string.general_no_subject); } - + if (from != null) { // Show From: address by default @@ -4599,7 +4599,7 @@ public class MessagingController implements Runnable { return false; } - + Address[] rcpts = message.getRecipients(Message.RecipientType.TO); String to = rcpts.length > 0 ? rcpts[0].toFriendly().toString() : null; if (to != null) @@ -4609,9 +4609,9 @@ public class MessagingController implements Runnable else { messageNotice.append(context.getString(R.string.general_no_sender) + ": "+subject); - + } - + } } } diff --git a/src/com/fsck/k9/helper/MessageHelper.java b/src/com/fsck/k9/helper/MessageHelper.java index b99ca8ec1..009f883b2 100644 --- a/src/com/fsck/k9/helper/MessageHelper.java +++ b/src/com/fsck/k9/helper/MessageHelper.java @@ -51,7 +51,7 @@ public class MessageHelper } public void populate(final MessageInfoHolder target, final Message m, - final FolderInfoHolder folder, final Account account) + final FolderInfoHolder folder, final Account account) { final Contacts contactHelper = Contacts.getInstance(mContext); try diff --git a/src/com/fsck/k9/helper/Utility.java b/src/com/fsck/k9/helper/Utility.java index 61629b548..a9d35de97 100644 --- a/src/com/fsck/k9/helper/Utility.java +++ b/src/com/fsck/k9/helper/Utility.java @@ -23,7 +23,7 @@ public class Utility // repetition matching as we might want to strip ML tags. Ex: // Re: [foo] Re: RE : [foo] blah blah blah private static final Pattern RESPONSE_PATTERN = Pattern.compile( - "((Re|Fw|Fwd|Aw|R\\u00E9f\\.)(\\[\\d+\\])?[\\u00A0 ]?: *)+", Pattern.CASE_INSENSITIVE); + "((Re|Fw|Fwd|Aw|R\\u00E9f\\.)(\\[\\d+\\])?[\\u00A0 ]?: *)+", Pattern.CASE_INSENSITIVE); /** * Mailing-list tag pattern to match strings like "[foobar] " @@ -406,11 +406,11 @@ public class Utility * Extract the 'original' subject value, by ignoring leading * response/forward marker and '[XX]' formatted tags (as many mailing-list * softwares do). - * + * *

* Result is also trimmed. *

- * + * * @param subject * Never null. * @return Never null. diff --git a/src/com/fsck/k9/mail/Address.java b/src/com/fsck/k9/mail/Address.java index d7068edb3..44dcf7f9e 100644 --- a/src/com/fsck/k9/mail/Address.java +++ b/src/com/fsck/k9/mail/Address.java @@ -38,7 +38,8 @@ public class Address private static final Address[] EMPTY_ADDRESS_ARRAY = new Address[0]; private static Map sContactsName = new ConcurrentHashMap(); - public static void clearContactsNameCache() { + public static void clearContactsNameCache() + { sContactsName.clear(); } @@ -263,16 +264,18 @@ public class Address if (name != null && name != NO_ENTRY) { - if (K9.changeRegisteredNameColor()) { + if (K9.changeRegisteredNameColor()) + { SpannableString sname = new SpannableString(name); sname.setSpan(new ForegroundColorSpan(K9.getRegisteredNameColor()), 0, sname.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE - ); + ); return sname; } - else { + else + { return name; } } @@ -287,19 +290,22 @@ public class Address { cursor.moveToFirst(); name = contacts.getName(cursor); // name might return null - if (name != null) { + if (name != null) + { sContactsName.put(mAddress, name); - if (K9.changeRegisteredNameColor()) { + if (K9.changeRegisteredNameColor()) + { SpannableString sname = new SpannableString(name); sname.setSpan(new ForegroundColorSpan(K9.getRegisteredNameColor()), 0, sname.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE - ); + ); return sname; } - else { + else + { return name; } } diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index 867e6becb..385e0ebf4 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -388,7 +388,8 @@ public class MimeUtility String extension = filename.substring(filename.lastIndexOf('.')+1).toLowerCase(); returnedType = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); } - if (returnedType != null) { + if (returnedType != null) + { return returnedType; } else diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index 3b223240e..00eb4376e 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -2660,13 +2660,13 @@ public class ImapStore extends Store } public List executeSimpleCommand(String command) throws IOException, - ImapException, MessagingException + ImapException, MessagingException { return executeSimpleCommand(command, false); } public List executeSimpleCommand(String command, boolean sensitive) throws IOException, - ImapException, MessagingException + ImapException, MessagingException { return executeSimpleCommand(command, sensitive, null); } diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index 3e683d4eb..b0acf4ca1 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -180,7 +180,8 @@ public class LocalStore extends Store implements Serializable + "DELETE FROM headers where old.id = message_id; END;"); } else - { // in the case that we're starting out at 29 or newer, run all the needed updates + { + // in the case that we're starting out at 29 or newer, run all the needed updates if (mDb.getVersion() < 30) { diff --git a/src/com/fsck/k9/mail/transport/SmtpTransport.java b/src/com/fsck/k9/mail/transport/SmtpTransport.java index fa4974322..706c4ed94 100644 --- a/src/com/fsck/k9/mail/transport/SmtpTransport.java +++ b/src/com/fsck/k9/mail/transport/SmtpTransport.java @@ -530,7 +530,7 @@ public class SmtpTransport extends Transport // S: 235 2.0.0 OK Authenticated private void saslAuthLogin(String username, String password) throws MessagingException, - AuthenticationFailedException, IOException + AuthenticationFailedException, IOException { try { @@ -550,7 +550,7 @@ public class SmtpTransport extends Transport } private void saslAuthPlain(String username, String password) throws MessagingException, - AuthenticationFailedException, IOException + AuthenticationFailedException, IOException { byte[] data = ("\000" + username + "\000" + password).getBytes(); data = new Base64().encode(data); @@ -570,7 +570,7 @@ public class SmtpTransport extends Transport } private void saslAuthCramMD5(String username, String password) throws MessagingException, - AuthenticationFailedException, IOException + AuthenticationFailedException, IOException { List respList = executeSimpleCommand("AUTH CRAM-MD5"); if (respList.size() != 1) throw new AuthenticationFailedException("Unable to negotiate CRAM-MD5"); diff --git a/src/com/fsck/k9/preferences/CheckBoxListPreference.java b/src/com/fsck/k9/preferences/CheckBoxListPreference.java index 436fc4e3b..f67788c11 100644 --- a/src/com/fsck/k9/preferences/CheckBoxListPreference.java +++ b/src/com/fsck/k9/preferences/CheckBoxListPreference.java @@ -45,15 +45,15 @@ public class CheckBoxListPreference extends DialogPreference System.arraycopy(mCheckedItems, 0, mPendingItems, 0, mCheckedItems.length); builder.setMultiChoiceItems(mItems, mPendingItems, - new DialogInterface.OnMultiChoiceClickListener() - { - @Override - public void onClick(final DialogInterface dialog, final int which, - final boolean isChecked) - { - mPendingItems[which] = isChecked; - } - }); + new DialogInterface.OnMultiChoiceClickListener() + { + @Override + public void onClick(final DialogInterface dialog, final int which, + final boolean isChecked) + { + mPendingItems[which] = isChecked; + } + }); } @Override diff --git a/src/com/fsck/k9/provider/MessageProvider.java b/src/com/fsck/k9/provider/MessageProvider.java index bcca8e821..3144b3f4c 100644 --- a/src/com/fsck/k9/provider/MessageProvider.java +++ b/src/com/fsck/k9/provider/MessageProvider.java @@ -38,7 +38,7 @@ public class MessageProvider extends ContentProvider { /** * The path this instance is able to respond to. - * + * * @return Never null. */ String getPath(); @@ -54,7 +54,7 @@ public class MessageProvider extends ContentProvider * @see {@link ContentProvider#query(Uri, String[], String, String[], String)} */ Cursor query(Uri uri, String[] projection, - String selection, String[] selectionArgs, String sortOrder) throws Exception; + String selection, String[] selectionArgs, String sortOrder) throws Exception; } /** @@ -71,7 +71,7 @@ public class MessageProvider extends ContentProvider @Override public Cursor query(final Uri uri, final String[] projection, final String selection, - final String[] selectionArgs, final String sortOrder) throws Exception + final String[] selectionArgs, final String sortOrder) throws Exception { return getMessages(projection); } @@ -94,13 +94,13 @@ public class MessageProvider extends ContentProvider final MessagingController msgController = MessagingController.getInstance(K9.app); msgController.searchLocalMessages(integratedInboxAccount, null, - new MesssageInfoHolderRetrieverListener(queue)); + new MesssageInfoHolderRetrieverListener(queue)); final List holders = queue.take(); // TODO add sort order parameter Collections.sort(holders, new MessageList.ReverseComparator( - new MessageList.DateComparator())); + new MessageList.DateComparator())); int id = -1; for (final MessageInfoHolder holder : holders) @@ -109,17 +109,18 @@ public class MessageProvider extends ContentProvider id++; cursor.addRow(new Object[] - { - id, - holder.fullDate, - holder.sender, - holder.subject, - holder.preview, - holder.account, - holder.uri, - CONTENT_URI + "/delete_message/" - + message.getFolder().getAccount().getAccountNumber() + "/" - + message.getFolder().getName() + "/" + message.getUid() }); + { + id, + holder.fullDate, + holder.sender, + holder.subject, + holder.preview, + holder.account, + holder.uri, + CONTENT_URI + "/delete_message/" + + message.getFolder().getAccount().getAccountNumber() + "/" + + message.getFolder().getName() + "/" + message.getUid() + }); } return cursor; } @@ -140,7 +141,7 @@ public class MessageProvider extends ContentProvider @Override public Cursor query(final Uri uri, String[] projection, String selection, - String[] selectionArgs, String sortOrder) throws Exception + String[] selectionArgs, String sortOrder) throws Exception { return getAllAccounts(); } @@ -179,7 +180,7 @@ public class MessageProvider extends ContentProvider @Override public Cursor query(final Uri uri, String[] projection, String selection, - String[] selectionArgs, String sortOrder) throws Exception + String[] selectionArgs, String sortOrder) throws Exception { List segments = null; int accountId = -1; @@ -261,7 +262,7 @@ public class MessageProvider extends ContentProvider final Account messageAccount = messageFolder.getAccount(); helper.populate(messageInfoHolder, message, new FolderInfoHolder(context, - messageFolder, messageAccount), messageAccount); + messageFolder, messageAccount), messageAccount); holders.add(messageInfoHolder); } @@ -419,7 +420,7 @@ public class MessageProvider extends ContentProvider @Override public Cursor query(final Uri uri, final String[] projection, final String selection, - final String[] selectionArgs, final String sortOrder) + final String[] selectionArgs, final String sortOrder) { if (K9.app == null) { @@ -477,7 +478,7 @@ public class MessageProvider extends ContentProvider /** * Register a {@link QueryHandler} to handle a certain {@link Uri} for * {@link #query(Uri, String[], String, String[], String)} - * + * * @param handler * Never null. */