Loading k9mail-library/src/main/java/com/fsck/k9/mail/internet/BinaryTempFileBody.java +9 −7 Original line number Diff line number Diff line Loading @@ -46,24 +46,26 @@ public class BinaryTempFileBody implements RawDataBody, SizeAware { try { File newFile = File.createTempFile("body", null, mTempDirectory); OutputStream out = new FileOutputStream(newFile); final OutputStream out = new FileOutputStream(newFile); try { OutputStream wrappedOut = null; if (MimeUtil.ENC_QUOTED_PRINTABLE.equals(encoding)) { out = new QuotedPrintableOutputStream(out, false); wrappedOut = new QuotedPrintableOutputStream(out, false); } else if (MimeUtil.ENC_BASE64.equals(encoding)) { out = new Base64OutputStream(out); wrappedOut = new Base64OutputStream(out); } else { throw new RuntimeException("Target encoding not supported: " + encoding); } InputStream in = getInputStream(); try { IOUtils.copy(in, out); IOUtils.copy(in, wrappedOut); } finally { in.close(); IOUtils.closeQuietly(in); IOUtils.closeQuietly(wrappedOut); } } finally { out.close(); IOUtils.closeQuietly(out); } mFile = newFile; Loading Loading @@ -100,7 +102,7 @@ public class BinaryTempFileBody implements RawDataBody, SizeAware { try { IOUtils.copy(in, out); } finally { in.close(); IOUtils.closeQuietly(in); } } Loading k9mail-library/src/main/java/com/fsck/k9/mail/internet/BinaryTempFileMessageBody.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class BinaryTempFileMessageBody extends BinaryTempFileBody implements Com IOUtils.copy(in, out); } } finally { in.close(); IOUtils.closeQuietly(in); } } Loading k9mail/src/main/java/com/fsck/k9/Account.java +1 −1 Original line number Diff line number Diff line Loading @@ -1404,7 +1404,7 @@ public class Account implements BaseAccount, StoreConfig { if (i < identities.size()) { return identities.get(i); } return null; throw new IllegalArgumentException("Identity with index " + i + " not found"); } public boolean isAnIdentity(Address[] addrs) { Loading k9mail/src/main/java/com/fsck/k9/activity/Accounts.java +33 −34 Original line number Diff line number Diff line Loading @@ -1183,10 +1183,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { if (menuInfo != null) { mSelectedContextAccount = (BaseAccount)getListView().getItemAtPosition(menuInfo.position); } Account realAccount = null; if (mSelectedContextAccount instanceof Account) { realAccount = (Account)mSelectedContextAccount; } Account realAccount = (Account)mSelectedContextAccount; switch (item.getItemId()) { case R.id.delete_account: onDeleteAccount(realAccount); Loading Loading @@ -1219,6 +1217,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { onMove(realAccount, false); break; } } return true; } Loading k9mail/src/main/java/com/fsck/k9/fragment/MessageListFragment.java +6 −14 Original line number Diff line number Diff line Loading @@ -1024,15 +1024,10 @@ public class MessageListFragment extends Fragment implements OnItemClickListener } private String getFolderNameById(Account account, long folderId) { try { Folder folder = getFolderById(account, folderId); if (folder != null) { return folder.getName(); } } catch (Exception e) { Log.e(K9.LOG_TAG, "getFolderNameById() failed.", e); } return null; } Loading @@ -1042,9 +1037,8 @@ public class MessageListFragment extends Fragment implements OnItemClickListener LocalFolder localFolder = localStore.getFolderById(folderId); localFolder.open(Folder.OPEN_MODE_RO); return localFolder; } catch (Exception e) { Log.e(K9.LOG_TAG, "getFolderNameById() failed.", e); return null; } catch (MessagingException e) { throw new RuntimeException(e); } } Loading Loading @@ -3162,10 +3156,8 @@ public class MessageListFragment extends Fragment implements OnItemClickListener try { return folder.getMessage(uid); } catch (MessagingException e) { Log.e(K9.LOG_TAG, "Something went wrong while fetching a message", e); throw new RuntimeException(e); } return null; } private List<LocalMessage> getCheckedMessages() { Loading Loading
k9mail-library/src/main/java/com/fsck/k9/mail/internet/BinaryTempFileBody.java +9 −7 Original line number Diff line number Diff line Loading @@ -46,24 +46,26 @@ public class BinaryTempFileBody implements RawDataBody, SizeAware { try { File newFile = File.createTempFile("body", null, mTempDirectory); OutputStream out = new FileOutputStream(newFile); final OutputStream out = new FileOutputStream(newFile); try { OutputStream wrappedOut = null; if (MimeUtil.ENC_QUOTED_PRINTABLE.equals(encoding)) { out = new QuotedPrintableOutputStream(out, false); wrappedOut = new QuotedPrintableOutputStream(out, false); } else if (MimeUtil.ENC_BASE64.equals(encoding)) { out = new Base64OutputStream(out); wrappedOut = new Base64OutputStream(out); } else { throw new RuntimeException("Target encoding not supported: " + encoding); } InputStream in = getInputStream(); try { IOUtils.copy(in, out); IOUtils.copy(in, wrappedOut); } finally { in.close(); IOUtils.closeQuietly(in); IOUtils.closeQuietly(wrappedOut); } } finally { out.close(); IOUtils.closeQuietly(out); } mFile = newFile; Loading Loading @@ -100,7 +102,7 @@ public class BinaryTempFileBody implements RawDataBody, SizeAware { try { IOUtils.copy(in, out); } finally { in.close(); IOUtils.closeQuietly(in); } } Loading
k9mail-library/src/main/java/com/fsck/k9/mail/internet/BinaryTempFileMessageBody.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class BinaryTempFileMessageBody extends BinaryTempFileBody implements Com IOUtils.copy(in, out); } } finally { in.close(); IOUtils.closeQuietly(in); } } Loading
k9mail/src/main/java/com/fsck/k9/Account.java +1 −1 Original line number Diff line number Diff line Loading @@ -1404,7 +1404,7 @@ public class Account implements BaseAccount, StoreConfig { if (i < identities.size()) { return identities.get(i); } return null; throw new IllegalArgumentException("Identity with index " + i + " not found"); } public boolean isAnIdentity(Address[] addrs) { Loading
k9mail/src/main/java/com/fsck/k9/activity/Accounts.java +33 −34 Original line number Diff line number Diff line Loading @@ -1183,10 +1183,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { if (menuInfo != null) { mSelectedContextAccount = (BaseAccount)getListView().getItemAtPosition(menuInfo.position); } Account realAccount = null; if (mSelectedContextAccount instanceof Account) { realAccount = (Account)mSelectedContextAccount; } Account realAccount = (Account)mSelectedContextAccount; switch (item.getItemId()) { case R.id.delete_account: onDeleteAccount(realAccount); Loading Loading @@ -1219,6 +1217,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { onMove(realAccount, false); break; } } return true; } Loading
k9mail/src/main/java/com/fsck/k9/fragment/MessageListFragment.java +6 −14 Original line number Diff line number Diff line Loading @@ -1024,15 +1024,10 @@ public class MessageListFragment extends Fragment implements OnItemClickListener } private String getFolderNameById(Account account, long folderId) { try { Folder folder = getFolderById(account, folderId); if (folder != null) { return folder.getName(); } } catch (Exception e) { Log.e(K9.LOG_TAG, "getFolderNameById() failed.", e); } return null; } Loading @@ -1042,9 +1037,8 @@ public class MessageListFragment extends Fragment implements OnItemClickListener LocalFolder localFolder = localStore.getFolderById(folderId); localFolder.open(Folder.OPEN_MODE_RO); return localFolder; } catch (Exception e) { Log.e(K9.LOG_TAG, "getFolderNameById() failed.", e); return null; } catch (MessagingException e) { throw new RuntimeException(e); } } Loading Loading @@ -3162,10 +3156,8 @@ public class MessageListFragment extends Fragment implements OnItemClickListener try { return folder.getMessage(uid); } catch (MessagingException e) { Log.e(K9.LOG_TAG, "Something went wrong while fetching a message", e); throw new RuntimeException(e); } return null; } private List<LocalMessage> getCheckedMessages() { Loading