1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Fix some compiler warnings

This commit is contained in:
cketti 2012-12-07 15:50:55 +01:00
parent 7b49f67c51
commit 8d652b2f61

View File

@ -1308,9 +1308,9 @@ public class LocalStore extends Store implements Serializable {
if (cursor.moveToFirst()) { if (cursor.moveToFirst()) {
int folderId = cursor.getInt(0); int folderId = cursor.getInt(0);
return (folderId > 0); return (folderId > 0);
} else {
return false;
} }
return false;
} finally { } finally {
Utility.closeQuietly(cursor); Utility.closeQuietly(cursor);
} }
@ -1505,30 +1505,20 @@ public class LocalStore extends Store implements Serializable {
@Override @Override
public FolderClass getSyncClass() { public FolderClass getSyncClass() {
if (FolderClass.INHERITED == mSyncClass) { return (FolderClass.INHERITED == mSyncClass) ? getDisplayClass() : mSyncClass;
return getDisplayClass();
} else {
return mSyncClass;
}
} }
public FolderClass getRawSyncClass() { public FolderClass getRawSyncClass() {
return mSyncClass; return mSyncClass;
} }
@Override @Override
public FolderClass getPushClass() { public FolderClass getPushClass() {
if (FolderClass.INHERITED == mPushClass) { return (FolderClass.INHERITED == mPushClass) ? getSyncClass() : mPushClass;
return getSyncClass();
} else {
return mPushClass;
}
} }
public FolderClass getRawPushClass() { public FolderClass getRawPushClass() {
return mPushClass; return mPushClass;
} }
public void setDisplayClass(FolderClass displayClass) throws MessagingException { public void setDisplayClass(FolderClass displayClass) throws MessagingException {
@ -2231,7 +2221,7 @@ public class LocalStore extends Store implements Serializable {
return appendMessages(messages, false); return appendMessages(messages, false);
} }
public void destroyMessages(final Message[] messages) throws MessagingException { public void destroyMessages(final Message[] messages) {
try { try {
database.execute(true, new DbCallback<Void>() { database.execute(true, new DbCallback<Void>() {
@Override @Override
@ -2787,10 +2777,10 @@ public class LocalStore extends Store implements Serializable {
} catch (WrappedException e) { } catch (WrappedException e) {
final Throwable cause = e.getCause(); final Throwable cause = e.getCause();
if (cause instanceof IOException) { if (cause instanceof IOException) {
throw(IOException) cause; throw (IOException) cause;
} else {
throw(MessagingException) cause;
} }
throw (MessagingException) cause;
} }
} }
@ -3061,12 +3051,7 @@ public class LocalStore extends Store implements Serializable {
// Remove any whitespace at the beginning and end of the string. // Remove any whitespace at the beginning and end of the string.
text = text.trim(); text = text.trim();
if (text.length() <= 512) { return (text.length() <= 512) ? text : text.substring(0, 512);
return text;
} else {
return text.substring(0, 512);
}
} }
@Override @Override
@ -3466,6 +3451,7 @@ public class LocalStore extends Store implements Serializable {
mMessageDirty = false; mMessageDirty = false;
} }
@Override
public String getPreview() { public String getPreview() {
return mPreview; return mPreview;
} }
@ -3489,13 +3475,9 @@ public class LocalStore extends Store implements Serializable {
mMessageDirty = true; mMessageDirty = true;
} }
@Override
public boolean hasAttachments() { public boolean hasAttachments() {
if (mAttachmentCount > 0) { return (mAttachmentCount > 0);
return true;
} else {
return false;
}
} }
public int getAttachmentCount() { public int getAttachmentCount() {
@ -3554,6 +3536,7 @@ public class LocalStore extends Store implements Serializable {
super.setFlag(flag, set); super.setFlag(flag, set);
} }
@Override
public long getId() { public long getId() {
return mId; return mId;
} }
@ -3877,6 +3860,7 @@ public class LocalStore extends Store implements Serializable {
mUri = uri; mUri = uri;
} }
@Override
public InputStream getInputStream() throws MessagingException { public InputStream getInputStream() throws MessagingException {
try { try {
return mApplication.getContentResolver().openInputStream(mUri); return mApplication.getContentResolver().openInputStream(mUri);
@ -3889,6 +3873,7 @@ public class LocalStore extends Store implements Serializable {
} }
} }
@Override
public void writeTo(OutputStream out) throws IOException, MessagingException { public void writeTo(OutputStream out) throws IOException, MessagingException {
InputStream in = getInputStream(); InputStream in = getInputStream();
Base64OutputStream base64Out = new Base64OutputStream(out); Base64OutputStream base64Out = new Base64OutputStream(out);