1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

Merge pull request #553

Remove redundant variable assignments
Minimize scope of local variables
This commit is contained in:
cketti 2015-03-06 23:13:54 +01:00
commit 67404b1883
2 changed files with 5 additions and 8 deletions

View File

@ -278,8 +278,6 @@ public class AccountSetupBasics extends K9Activity
String[] emailParts = splitEmail(email);
String user = emailParts[0];
String domain = emailParts[1];
URI incomingUri = null;
URI outgoingUri = null;
try {
String userEnc = UrlEncodingHelper.encodeUtf8(user);
String passwordEnc = UrlEncodingHelper.encodeUtf8(password);
@ -290,15 +288,15 @@ public class AccountSetupBasics extends K9Activity
incomingUsername = incomingUsername.replaceAll("\\$domain", domain);
URI incomingUriTemplate = mProvider.incomingUriTemplate;
incomingUri = new URI(incomingUriTemplate.getScheme(), incomingUsername + ":"
+ passwordEnc, incomingUriTemplate.getHost(), incomingUriTemplate.getPort(), null,
null, null);
URI incomingUri = new URI(incomingUriTemplate.getScheme(), incomingUsername + ":" + passwordEnc,
incomingUriTemplate.getHost(), incomingUriTemplate.getPort(), null, null, null);
String outgoingUsername = mProvider.outgoingUsernameTemplate;
URI outgoingUriTemplate = mProvider.outgoingUriTemplate;
URI outgoingUri;
if (outgoingUsername != null) {
outgoingUsername = outgoingUsername.replaceAll("\\$email", email);
outgoingUsername = outgoingUsername.replaceAll("\\$user", userEnc);
@ -401,7 +399,7 @@ public class AccountSetupBasics extends K9Activity
String password = null;
String clientCertificateAlias = null;
AuthType authenticationType = null;
AuthType authenticationType;
if (mClientCertificateCheckBox.isChecked()) {
authenticationType = AuthType.EXTERNAL;
clientCertificateAlias = mClientCertificateSpinner.getAlias();

View File

@ -67,9 +67,8 @@ public class FolderSettings extends K9PreferenceActivity {
}
boolean isPushCapable = false;
Store store = null;
try {
store = mAccount.getRemoteStore();
Store store = mAccount.getRemoteStore();
isPushCapable = store.isPushCapable();
} catch (Exception e) {
Log.e(K9.LOG_TAG, "Could not get remote store", e);