create outside of loop

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-01-28 09:47:11 +01:00
parent 51d7ea8cd6
commit 9582b3ea86
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -234,6 +234,7 @@ public final class AccountUtils {
String displayName; String displayName;
String newAccountName; String newAccountName;
Account newAccount; Account newAccount;
GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation();
for (Account account : ocAccounts) { for (Account account : ocAccounts) {
// build new account name // build new account name
@ -245,7 +246,6 @@ public final class AccountUtils {
OwnCloudClient client = OwnCloudClientManagerFactory.getDefaultSingleton() OwnCloudClient client = OwnCloudClientManagerFactory.getDefaultSingleton()
.getClientFor(ocAccount, context); .getClientFor(ocAccount, context);
GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation();
RemoteOperationResult result = remoteUserNameOperation.execute(client); RemoteOperationResult result = remoteUserNameOperation.execute(client);
if (result.isSuccess()) { if (result.isSuccess()) {