1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -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[] emailParts = splitEmail(email);
String user = emailParts[0]; String user = emailParts[0];
String domain = emailParts[1]; String domain = emailParts[1];
URI incomingUri = null;
URI outgoingUri = null;
try { try {
String userEnc = UrlEncodingHelper.encodeUtf8(user); String userEnc = UrlEncodingHelper.encodeUtf8(user);
String passwordEnc = UrlEncodingHelper.encodeUtf8(password); String passwordEnc = UrlEncodingHelper.encodeUtf8(password);
@ -290,15 +288,15 @@ public class AccountSetupBasics extends K9Activity
incomingUsername = incomingUsername.replaceAll("\\$domain", domain); incomingUsername = incomingUsername.replaceAll("\\$domain", domain);
URI incomingUriTemplate = mProvider.incomingUriTemplate; URI incomingUriTemplate = mProvider.incomingUriTemplate;
incomingUri = new URI(incomingUriTemplate.getScheme(), incomingUsername + ":" URI incomingUri = new URI(incomingUriTemplate.getScheme(), incomingUsername + ":" + passwordEnc,
+ passwordEnc, incomingUriTemplate.getHost(), incomingUriTemplate.getPort(), null, incomingUriTemplate.getHost(), incomingUriTemplate.getPort(), null, null, null);
null, null);
String outgoingUsername = mProvider.outgoingUsernameTemplate; String outgoingUsername = mProvider.outgoingUsernameTemplate;
URI outgoingUriTemplate = mProvider.outgoingUriTemplate; URI outgoingUriTemplate = mProvider.outgoingUriTemplate;
URI outgoingUri;
if (outgoingUsername != null) { if (outgoingUsername != null) {
outgoingUsername = outgoingUsername.replaceAll("\\$email", email); outgoingUsername = outgoingUsername.replaceAll("\\$email", email);
outgoingUsername = outgoingUsername.replaceAll("\\$user", userEnc); outgoingUsername = outgoingUsername.replaceAll("\\$user", userEnc);
@ -401,7 +399,7 @@ public class AccountSetupBasics extends K9Activity
String password = null; String password = null;
String clientCertificateAlias = null; String clientCertificateAlias = null;
AuthType authenticationType = null; AuthType authenticationType;
if (mClientCertificateCheckBox.isChecked()) { if (mClientCertificateCheckBox.isChecked()) {
authenticationType = AuthType.EXTERNAL; authenticationType = AuthType.EXTERNAL;
clientCertificateAlias = mClientCertificateSpinner.getAlias(); clientCertificateAlias = mClientCertificateSpinner.getAlias();

View File

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