mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 00:58:50 -05:00
Removed unnecessary null pointer checks
This commit is contained in:
parent
4e11c17ff5
commit
22834d6998
@ -558,11 +558,8 @@ public class FolderList extends K9ListActivity
|
||||
}
|
||||
localFolder = account.getLocalStore().getFolder(folderName);
|
||||
localFolder.open(Folder.OpenMode.READ_WRITE);
|
||||
if (localFolder != null)
|
||||
{
|
||||
localFolder.clearAllMessages();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.e(K9.LOG_TAG, "Exception while clearing folder", e);
|
||||
@ -1093,8 +1090,6 @@ public class FolderList extends K9ListActivity
|
||||
}
|
||||
localFolder = account.getLocalStore().getFolder(folderName);
|
||||
int unreadMessageCount = localFolder.getUnreadMessageCount();
|
||||
if (localFolder != null)
|
||||
{
|
||||
FolderInfoHolder folderHolder = getFolder(folderName);
|
||||
if (folderHolder != null)
|
||||
{
|
||||
@ -1103,7 +1098,6 @@ public class FolderList extends K9ListActivity
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.e(K9.LOG_TAG, "Exception while populating folder", e);
|
||||
|
@ -478,7 +478,7 @@ public class MessagingController implements Runnable
|
||||
|
||||
Folder[] folderArray = localFolders.toArray(EMPTY_FOLDER_ARRAY);
|
||||
|
||||
if (refreshRemote || localFolders == null || localFolders.size() == 0)
|
||||
if (refreshRemote || localFolders.size() == 0)
|
||||
{
|
||||
doRefreshRemote(account, listener);
|
||||
return;
|
||||
|
@ -97,7 +97,7 @@ public class ImapResponseParser
|
||||
* See RFC 3501, Section 9 Formal Syntax (resp-text)
|
||||
*/
|
||||
}
|
||||
response.mCompleted = (token == null);
|
||||
response.mCompleted = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -639,7 +639,8 @@ public class ImapResponseParser
|
||||
}
|
||||
else
|
||||
{
|
||||
return o1 == o2;
|
||||
// Both o1 and o2 are null
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3146,10 +3146,6 @@ public class ImapStore extends Store
|
||||
idling.set(true);
|
||||
doneSent.set(false);
|
||||
|
||||
if (conn == null)
|
||||
{
|
||||
throw new MessagingException("No connection available for idling");
|
||||
}
|
||||
conn.setReadTimeout((getAccount().getIdleRefreshMinutes() * 60 * 1000) + IDLE_READ_TIMEOUT_INCREMENT);
|
||||
untaggedResponses = executeSimpleCommand(COMMAND_IDLE, false, ImapFolderPusher.this);
|
||||
idling.set(false);
|
||||
|
@ -2456,11 +2456,8 @@ public class WebDavStore extends Store
|
||||
}
|
||||
}
|
||||
|
||||
if (envelope != null)
|
||||
{
|
||||
envelopes.put(uid, envelope);
|
||||
}
|
||||
}
|
||||
|
||||
return envelopes;
|
||||
}
|
||||
|
@ -314,12 +314,9 @@ public class Storage implements SharedPreferences
|
||||
workingStorage.remove();
|
||||
workingChangedKeys.remove();
|
||||
mDb.endTransaction();
|
||||
if (mDb != null)
|
||||
{
|
||||
mDb.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public long size()
|
||||
{
|
||||
|
@ -77,11 +77,8 @@ public class BootReceiver extends CoreReceiver
|
||||
Log.i(K9.LOG_TAG, "BootReceiver Got alarm to fire alarmedIntent " + alarmedAction);
|
||||
alarmedIntent.putExtra(WAKE_LOCK_ID, tmpWakeLockId);
|
||||
tmpWakeLockId = null;
|
||||
if (alarmedIntent != null)
|
||||
{
|
||||
context.startService(alarmedIntent);
|
||||
}
|
||||
}
|
||||
else if (SCHEDULE_INTENT.equals(action))
|
||||
{
|
||||
long atTime = intent.getLongExtra(AT_TIME, -1);
|
||||
|
@ -95,15 +95,11 @@ public abstract class CoreService extends Service
|
||||
startService(intent, startId);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (wakeLock != null)
|
||||
{
|
||||
wakeLock.release();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void execute(Context context, final Runnable runner, int wakeLockTime, final Integer startId)
|
||||
{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user