Merge pull request #2910 from jyn514/unused-vars

Removed unused variables
This commit is contained in:
cketti 2017-12-30 03:30:14 +01:00 committed by GitHub
commit 0cf4b8aaa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 16 additions and 31 deletions

View file

@ -76,9 +76,8 @@ public class Authentication {
byte[] result = md.digest(firstPass);
String plainCRAM = username + " " + Hex.encodeHex(result);
byte[] b64CRAM = Base64.encodeBase64(plainCRAM.getBytes());
return b64CRAM;
return Base64.encodeBase64(plainCRAM.getBytes());
} catch (Exception e) {
throw new MessagingException("Something went wrong during CRAM-MD5 computation", e);

View file

@ -64,9 +64,8 @@ class Iso2022JpToShiftJisInputStream extends InputStream {
throw new MalformedInputException(0);
int out1 = (in1 + 1) / 2 + (in1 < 0x5f ? 0x70 : 0xb0);
int out2 = in2 + (in1 % 2 == 0 ? 0x7e : in2 < 0x60 ? 0x1f : 0x20);
out = out2;
out = in2 + (in1 % 2 == 0 ? 0x7e : in2 < 0x60 ? 0x1f : 0x20);
hasOut = true;
return out1;

View file

@ -171,8 +171,7 @@ public abstract class AccountList extends K9ListActivity implements OnItemClickL
class LoadAccounts extends AsyncTask<Void, Void, List<Account>> {
@Override
protected List<Account> doInBackground(Void... params) {
List<Account> accounts = Preferences.getPreferences(getApplicationContext()).getAccounts();
return accounts;
return Preferences.getPreferences(getApplicationContext()).getAccounts();
}
@Override

View file

@ -376,9 +376,8 @@ public class RecipientLoader extends AsyncTaskLoader<List<Recipient>> {
Recipient recipient = new Recipient(name, email, addressLabel, contactId, lookupKey);
if (recipient.isValidEmailAddress()) {
Uri photoUri = cursor.isNull(INDEX_PHOTO_URI) ? null : Uri.parse(cursor.getString(INDEX_PHOTO_URI));
recipient.photoThumbnailUri = photoUri;
recipient.photoThumbnailUri = cursor.isNull(INDEX_PHOTO_URI) ? null : Uri.parse(cursor.getString(INDEX_PHOTO_URI));
recipientMap.put(email, recipient);
recipients.add(recipient);
}

View file

@ -385,7 +385,6 @@ public class AccountSetupBasics extends K9Activity
private void onManualSetup() {
String email = mEmailView.getText().toString();
String[] emailParts = splitEmail(email);
String user = email;
String domain = emailParts[1];
String password = null;
@ -408,9 +407,9 @@ public class AccountSetupBasics extends K9Activity
// set default uris
// NOTE: they will be changed again in AccountSetupAccountType!
ServerSettings storeServer = new ServerSettings(ServerSettings.Type.IMAP, "mail." + domain, -1,
ConnectionSecurity.SSL_TLS_REQUIRED, authenticationType, user, password, clientCertificateAlias);
ConnectionSecurity.SSL_TLS_REQUIRED, authenticationType, email, password, clientCertificateAlias);
ServerSettings transportServer = new ServerSettings(ServerSettings.Type.SMTP, "mail." + domain, -1,
ConnectionSecurity.SSL_TLS_REQUIRED, authenticationType, user, password, clientCertificateAlias);
ConnectionSecurity.SSL_TLS_REQUIRED, authenticationType, email, password, clientCertificateAlias);
String storeUri = RemoteStore.createStoreUri(storeServer);
String transportUri = TransportUris.createTransportUri(transportServer);
mAccount.setStoreUri(storeUri);

View file

@ -48,13 +48,12 @@ public class MlfUtils {
}
static String buildSubject(String subjectFromCursor, String emptySubject, int threadCount) {
String subject = subjectFromCursor;
if (TextUtils.isEmpty(subject)) {
if (TextUtils.isEmpty(subjectFromCursor)) {
return emptySubject;
} else if (threadCount > 1) {
// If this is a thread, strip the RE/FW from the subject. "Be like Outlook."
return Utility.stripSubject(subject);
return Utility.stripSubject(subjectFromCursor);
}
return subject;
return subjectFromCursor;
}
}

View file

@ -265,13 +265,12 @@ public class Contacts {
*/
private Cursor getContactByAddress(final String address) {
final Uri uri = Uri.withAppendedPath(ContactsContract.CommonDataKinds.Email.CONTENT_LOOKUP_URI, Uri.encode(address));
final Cursor c = mContentResolver.query(
return mContentResolver.query(
uri,
PROJECTION,
null,
null,
SORT_ORDER);
return c;
}
}

View file

@ -1009,8 +1009,7 @@ public class SettingsImporter {
private static ImportedFolder parseFolder(XmlPullParser xpp) throws XmlPullParserException, IOException {
ImportedFolder folder = new ImportedFolder();
String name = xpp.getAttributeValue(null, SettingsExporter.NAME_ATTRIBUTE);
folder.name = name;
folder.name = xpp.getAttributeValue(null, SettingsExporter.NAME_ATTRIBUTE);
folder.settings = parseSettings(xpp, SettingsExporter.FOLDER_ELEMENT);

View file

@ -83,8 +83,7 @@ public class BootReceiver extends CoreReceiver {
i.putExtra(ALARMED_INTENT, alarmedIntent);
Uri uri = Uri.parse("action://" + alarmedAction);
i.setData(uri);
PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0);
return pi;
return PendingIntent.getBroadcast(context, 0, i, 0);
}
public static void scheduleIntent(Context context, long atTime, Intent alarmedIntent) {

View file

@ -122,13 +122,12 @@ public class MessageViewInfoExtractorTest {
MessageExtractor.findViewablesAndAttachments(message, outputViewableParts, outputNonViewableParts);
ViewableExtractedText container = messageViewInfoExtractor.extractTextFromViewables(outputViewableParts);
String expectedText = BODY_TEXT;
String expectedHtml =
"<pre class=\"k9mail\">" +
"K-9 Mail rocks :&gt;" +
"</pre>";
assertEquals(expectedText, container.text);
assertEquals(BODY_TEXT, container.text);
assertEquals(expectedHtml, container.html);
}
@ -177,12 +176,8 @@ public class MessageViewInfoExtractorTest {
assertEquals(outputViewableParts.size(), 1);
ViewableExtractedText container = messageViewInfoExtractor.extractTextFromViewables(outputViewableParts);
String expectedText = BODY_TEXT;
String expectedHtml =
bodyText;
assertEquals(expectedText, container.text);
assertEquals(expectedHtml, container.html);
assertEquals(BODY_TEXT, container.text);
assertEquals(bodyText, container.html);
}
@Test

View file

@ -133,7 +133,7 @@ public class TextBodyBuilderTest {
public String makeExpectedHtmlContent(String expectedText, String quotedContent,
int footerInsertionPoint, boolean isBefore,
String userContent, String compiledResult) {
String expectedHtmlContent = "InsertableHtmlContent{"
return "InsertableHtmlContent{"
+ "headerInsertionPoint=0,"
+ " footerInsertionPoint=" + footerInsertionPoint + ","
+ " insertionLocation=" + (isBefore ? "BEFORE_QUOTE" : "AFTER_QUOTE") + ","
@ -141,7 +141,6 @@ public class TextBodyBuilderTest {
+ " userContent=" + userContent + ","
+ " compiledResult=" + compiledResult
+ "}";
return expectedHtmlContent;
}
@Theory