Fix 3 problems that FindBugs found.
Bug 2666278 [findbugs] broken double-lock pettern in Utility.FolderProperties.getInstance() Bug 2666207 [findbugs] potential NPE in MessagingController.processPendingDeletesSynchronous() Bug 2666195 [findbugs] Potential NPE in AccountSetupNames.onCreate() Change-Id: I2ee5bd5b7c80f8bdd32b3c45abb655a3d3fb8c9e
This commit is contained in:
parent
0641930342
commit
1f2caa8095
|
@ -1090,10 +1090,10 @@ public class MessagingController implements Runnable {
|
|||
boolean deleteFromTrash = false;
|
||||
|
||||
EmailContent.Message oldMessage =
|
||||
EmailContent.getContent(deletes, EmailContent.Message.class);
|
||||
lastMessageId = oldMessage.mId;
|
||||
EmailContent.getContent(deletes, EmailContent.Message.class);
|
||||
|
||||
if (oldMessage != null) {
|
||||
lastMessageId = oldMessage.mId;
|
||||
if (mailbox == null || mailbox.mId != oldMessage.mMailboxKey) {
|
||||
mailbox = Mailbox.restoreMailboxWithId(mContext, oldMessage.mMailboxKey);
|
||||
}
|
||||
|
|
|
@ -321,13 +321,9 @@ public class Utility {
|
|||
context.getResources().getDrawable(R.drawable.ic_list_combined_inbox);
|
||||
}
|
||||
|
||||
public static FolderProperties getInstance(Context context) {
|
||||
public static synchronized FolderProperties getInstance(Context context) {
|
||||
if (sInstance == null) {
|
||||
synchronized (FolderProperties.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new FolderProperties(context);
|
||||
}
|
||||
}
|
||||
sInstance = new FolderProperties(context);
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
|
|
@ -101,6 +101,7 @@ public class AccountSetupNames extends Activity implements OnClickListener {
|
|||
HostAuth hostAuth = HostAuth.restoreHostAuthWithId(this, mAccount.mHostAuthKeyRecv);
|
||||
if (hostAuth == null) {
|
||||
onBackPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
// Remember whether we're an EAS account, since it doesn't require the user name field
|
||||
|
|
Loading…
Reference in New Issue