mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Avoid confusing reuse of local variables
This commit is contained in:
parent
492d65feed
commit
d5d42469b0
@ -51,17 +51,17 @@ public class AccountSetupAccountType extends K9Activity implements OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupStoreAndSmtpTransport(String schemePrefix) throws URISyntaxException {
|
private void setupStoreAndSmtpTransport(String schemePrefix) throws URISyntaxException {
|
||||||
URI uri = new URI(mAccount.getStoreUri());
|
URI storeUriForDecode = new URI(mAccount.getStoreUri());
|
||||||
uri = new URI(schemePrefix, uri.getUserInfo(), uri.getHost(), uri.getPort(), null, null, null);
|
URI storeUri = new URI(schemePrefix, storeUriForDecode.getUserInfo(), storeUriForDecode.getHost(), storeUriForDecode.getPort(), null, null, null);
|
||||||
mAccount.setStoreUri(uri.toString());
|
mAccount.setStoreUri(storeUri.toString());
|
||||||
|
|
||||||
uri = new URI(mAccount.getTransportUri());
|
URI transportUriForDecode = new URI(mAccount.getTransportUri());
|
||||||
uri = new URI("smtp+tls+", uri.getUserInfo(), uri.getHost(), uri.getPort(), null, null, null);
|
URI transportUri = new URI("smtp+tls+", transportUriForDecode.getUserInfo(), transportUriForDecode.getHost(), transportUriForDecode.getPort(), null, null, null);
|
||||||
mAccount.setTransportUri(uri.toString());
|
mAccount.setTransportUri(transportUri.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupDav() throws URISyntaxException {
|
private void setupDav() throws URISyntaxException {
|
||||||
URI uri = new URI(mAccount.getStoreUri());
|
URI uriForDecode = new URI(mAccount.getStoreUri());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The user info we have been given from
|
* The user info we have been given from
|
||||||
@ -71,14 +71,14 @@ public class AccountSetupAccountType extends K9Activity implements OnClickListen
|
|||||||
* URI. Re-encode without it, using just the UserName and Password.
|
* URI. Re-encode without it, using just the UserName and Password.
|
||||||
*/
|
*/
|
||||||
String userPass = "";
|
String userPass = "";
|
||||||
String[] userInfo = uri.getUserInfo().split(":");
|
String[] userInfo = uriForDecode.getUserInfo().split(":");
|
||||||
if (userInfo.length > 1) {
|
if (userInfo.length > 1) {
|
||||||
userPass = userInfo[1];
|
userPass = userInfo[1];
|
||||||
}
|
}
|
||||||
if (userInfo.length > 2) {
|
if (userInfo.length > 2) {
|
||||||
userPass = userPass + ":" + userInfo[2];
|
userPass = userPass + ":" + userInfo[2];
|
||||||
}
|
}
|
||||||
uri = new URI("webdav+ssl+", userPass, uri.getHost(), uri.getPort(), null, null, null);
|
URI uri = new URI("webdav+ssl+", userPass, uriForDecode.getHost(), uriForDecode.getPort(), null, null, null);
|
||||||
mAccount.setStoreUri(uri.toString());
|
mAccount.setStoreUri(uri.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user