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); byte[] result = md.digest(firstPass);
String plainCRAM = username + " " + Hex.encodeHex(result); String plainCRAM = username + " " + Hex.encodeHex(result);
byte[] b64CRAM = Base64.encodeBase64(plainCRAM.getBytes());
return b64CRAM; return Base64.encodeBase64(plainCRAM.getBytes());
} catch (Exception e) { } catch (Exception e) {
throw new MessagingException("Something went wrong during CRAM-MD5 computation", 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); throw new MalformedInputException(0);
int out1 = (in1 + 1) / 2 + (in1 < 0x5f ? 0x70 : 0xb0); 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; hasOut = true;
return out1; return out1;

View file

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

View file

@ -376,9 +376,8 @@ public class RecipientLoader extends AsyncTaskLoader<List<Recipient>> {
Recipient recipient = new Recipient(name, email, addressLabel, contactId, lookupKey); Recipient recipient = new Recipient(name, email, addressLabel, contactId, lookupKey);
if (recipient.isValidEmailAddress()) { 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); recipientMap.put(email, recipient);
recipients.add(recipient); recipients.add(recipient);
} }

View file

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

View file

@ -48,13 +48,12 @@ public class MlfUtils {
} }
static String buildSubject(String subjectFromCursor, String emptySubject, int threadCount) { static String buildSubject(String subjectFromCursor, String emptySubject, int threadCount) {
String subject = subjectFromCursor; if (TextUtils.isEmpty(subjectFromCursor)) {
if (TextUtils.isEmpty(subject)) {
return emptySubject; return emptySubject;
} else if (threadCount > 1) { } else if (threadCount > 1) {
// If this is a thread, strip the RE/FW from the subject. "Be like Outlook." // 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) { private Cursor getContactByAddress(final String address) {
final Uri uri = Uri.withAppendedPath(ContactsContract.CommonDataKinds.Email.CONTENT_LOOKUP_URI, Uri.encode(address)); final Uri uri = Uri.withAppendedPath(ContactsContract.CommonDataKinds.Email.CONTENT_LOOKUP_URI, Uri.encode(address));
final Cursor c = mContentResolver.query( return mContentResolver.query(
uri, uri,
PROJECTION, PROJECTION,
null, null,
null, null,
SORT_ORDER); SORT_ORDER);
return c;
} }
} }

View file

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

View file

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

View file

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

View file

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