Removed unnecessary type casts

This commit is contained in:
cketti 2011-01-19 01:21:27 +00:00
parent 14a20843e3
commit 7119c7165f
7 changed files with 14 additions and 14 deletions

View file

@ -815,7 +815,7 @@ public class FolderList extends K9ListActivity
FolderInfoHolder folder = (FolderInfoHolder) mAdapter.getItem(info.position);
menu.setHeaderTitle((CharSequence) folder.displayName);
menu.setHeaderTitle(folder.displayName);
if (!folder.name.equals(mAccount.getTrashFolderName()))
menu.findItem(R.id.empty_trash).setVisible(false);
@ -1285,7 +1285,7 @@ public class FolderList extends K9ListActivity
{
FolderInfoHolder searchHolder = new FolderInfoHolder();
searchHolder.name = folder;
return mFolders.indexOf((Object) searchHolder);
return mFolders.indexOf(searchHolder);
}
public FolderInfoHolder getFolder(String folder)

View file

@ -336,7 +336,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
final Intent intent = getIntent();
mMessageReference = (MessageReference) intent.getSerializableExtra(EXTRA_MESSAGE_REFERENCE);
mSourceMessageBody = (String) intent.getStringExtra(EXTRA_MESSAGE_BODY);
mSourceMessageBody = intent.getStringExtra(EXTRA_MESSAGE_BODY);
if(K9.DEBUG && mSourceMessageBody != null)
Log.d(K9.LOG_TAG, "Composing message with explicitly specified message body.");
@ -559,7 +559,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
mMessageContentView.requestFocus();
}
mEncryptLayout = (View)findViewById(R.id.layout_encrypt);
mEncryptLayout = findViewById(R.id.layout_encrypt);
mCryptoSignatureCheckbox = (CheckBox)findViewById(R.id.cb_crypto_signature);
mCryptoSignatureUserId = (TextView)findViewById(R.id.userId);
mCryptoSignatureUserIdRest = (TextView)findViewById(R.id.userIdRest);
@ -844,7 +844,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
protected void onRestoreInstanceState(Bundle savedInstanceState)
{
super.onRestoreInstanceState(savedInstanceState);
ArrayList<Parcelable> attachments = (ArrayList<Parcelable>) savedInstanceState.getParcelableArrayList(STATE_KEY_ATTACHMENTS);
ArrayList<Parcelable> attachments = savedInstanceState.getParcelableArrayList(STATE_KEY_ATTACHMENTS);
mAttachments.removeAllViews();
for (Parcelable p : attachments)
{

View file

@ -2030,7 +2030,7 @@ public class MessageList
getMenuInflater().inflate(R.menu.message_list_context, menu);
menu.setHeaderTitle((CharSequence) message.message.getSubject());
menu.setHeaderTitle(message.message.getSubject());
if (message.read)
{
@ -2518,7 +2518,7 @@ public class MessageList
{
LocalStore localStore = account.getLocalStore();
local_folder = localStore.getFolder(folder);
return new FolderInfoHolder(context, (Folder)local_folder, account);
return new FolderInfoHolder(context, local_folder, account);
}
catch (Exception e)
{
@ -2560,7 +2560,7 @@ public class MessageList
MessageInfoHolder messageHolder =(MessageInfoHolder) getItem(position);
if (messageHolder != null)
{
return ((LocalStore.LocalMessage) messageHolder.message).getId();
return messageHolder.message.getId();
}
}
catch (Exception e)
@ -2748,7 +2748,7 @@ public class MessageList
holder.subject.setTypeface(null, message.read ? Typeface.NORMAL : Typeface.BOLD);
// XXX TODO there has to be some way to walk our view hierarchy and get this
holder.flagged.setTag((Integer)position);
holder.flagged.setTag(position);
holder.flagged.setChecked(message.flagged);
// So that the mSelectedCount is only incremented/decremented

View file

@ -650,7 +650,7 @@ public class MessageView extends K9Activity implements OnClickListener
private void setupDecryptLayout()
{
mDecryptLayout = (View) findViewById(R.id.layout_decrypt);
mDecryptLayout = findViewById(R.id.layout_decrypt);
mDecryptButton = (Button) findViewById(R.id.btn_decrypt);
mDecryptButton.setOnClickListener(new OnClickListener()
{
@ -1554,7 +1554,7 @@ public class MessageView extends K9Activity implements OnClickListener
AttachmentView view = (AttachmentView)inflater.inflate(R.layout.message_view_attachment, null);
if (view.populateFromPart(part, mMessage, mAccount, mController, mListener))
{
mHandler.addAttachment((View)view);
mHandler.addAttachment(view);
}
return;
}

View file

@ -512,7 +512,7 @@ public class AccountSettings extends K9PreferenceActivity
mLocalStorageProvider.setEntryValues(providerIds);
mLocalStorageProvider.setEntries(providerLabels);
mLocalStorageProvider.setValue(mAccount.getLocalStorageProviderId());
mLocalStorageProvider.setSummary(providers.get((Object)mAccount.getLocalStorageProviderId()));
mLocalStorageProvider.setSummary(providers.get(mAccount.getLocalStorageProviderId()));
mLocalStorageProvider.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
{

View file

@ -92,7 +92,7 @@ public class MimeMultipart extends Multipart
for (int i = 0, count = mParts.size(); i < count; i++)
{
BodyPart bodyPart = (BodyPart)mParts.get(i);
BodyPart bodyPart = mParts.get(i);
writer.write("--" + mBoundary + "\r\n");
writer.flush();
bodyPart.writeTo(out);

View file

@ -281,7 +281,7 @@ public class ImapResponseParser
{
if (sb.length() == 0)
{
throw new IOException(String.format("parseAtom(): (%04x %c)", (int)ch, ch));
throw new IOException(String.format("parseAtom(): (%04x %c)", ch, ch));
}
return sb.toString();
}