Revert "findbugs replaced byte[].toString() with Arrays.toString(byte[])(cherry picked from commit ce7c6d2357)"

This reverts commit 55ec8f3a2d.
This commit is contained in:
Daan Hoogland 2014-02-03 10:47:19 +01:00
parent 92abb9439e
commit 8e96111c55
2 changed files with 4 additions and 16 deletions

View File

@ -18,7 +18,6 @@ package org.apache.cloudstack.api.command;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Map;
import javax.inject.Inject;
@ -126,7 +125,7 @@ public class LdapCreateAccountCmd extends BaseCmd {
final SecureRandom randomGen = SecureRandom.getInstance("SHA1PRNG");
final byte bytes[] = new byte[20];
randomGen.nextBytes(bytes);
return Arrays.toString(Base64.encode(bytes));
return Base64.encode(bytes).toString();
} catch (final NoSuchAlgorithmException e) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
"Failed to generate random password");

View File

@ -19,19 +19,13 @@ package org.apache.cloudstack.api.command;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.inject.Inject;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.*;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.LdapUserResponse;
import org.apache.cloudstack.api.response.ListResponse;
@ -43,12 +37,7 @@ import org.apache.log4j.Logger;
import org.bouncycastle.util.encoders.Base64;
import com.cloud.domain.Domain;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.exception.*;
import com.cloud.user.AccountService;
import com.cloud.user.DomainService;
@ -186,7 +175,7 @@ public class LdapImportUsersCmd extends BaseListCmd {
final SecureRandom randomGen = SecureRandom.getInstance("SHA1PRNG");
final byte bytes[] = new byte[20];
randomGen.nextBytes(bytes);
return Arrays.toString(Base64.encode(bytes));
return Base64.encode(bytes).toString();
} catch (final NoSuchAlgorithmException e) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to generate random password");
}