You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2014/01/31 03:08:11 UTC

[08/11] git commit: updated refs/heads/4.3 to e089b91

findbugs replaced byte[].toString() with Arrays.toString(byte[])(cherry picked from commit ce7c6d23575d455a8273b77702a56b7bb419b37b)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/55ec8f3a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/55ec8f3a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/55ec8f3a

Branch: refs/heads/4.3
Commit: 55ec8f3a2d8ae73ae1e20a806a8f8d0ee29fa274
Parents: 602faec
Author: Daan Hoogland <dh...@schubergphilis.com>
Authored: Thu Jan 30 15:25:19 2014 +0100
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Thu Jan 30 17:57:50 2014 -0800

----------------------------------------------------------------------
 .../api/command/LdapCreateAccountCmd.java          |  3 ++-
 .../cloudstack/api/command/LdapImportUsersCmd.java | 17 ++++++++++++++---
 2 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/55ec8f3a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
index 981e72e..3afa22b 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapCreateAccountCmd.java
@@ -18,6 +18,7 @@ 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;
@@ -125,7 +126,7 @@ public class LdapCreateAccountCmd extends BaseCmd {
 			final SecureRandom randomGen = SecureRandom.getInstance("SHA1PRNG");
 			final byte bytes[] = new byte[20];
 			randomGen.nextBytes(bytes);
-			return Base64.encode(bytes).toString();
+            return Arrays.toString(Base64.encode(bytes));
 		} catch (final NoSuchAlgorithmException e) {
 			throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
 					"Failed to generate random password");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/55ec8f3a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
index 1855d5d..41eacf0 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LdapImportUsersCmd.java
@@ -19,13 +19,19 @@ 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.*;
+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.response.DomainResponse;
 import org.apache.cloudstack.api.response.LdapUserResponse;
 import org.apache.cloudstack.api.response.ListResponse;
@@ -37,7 +43,12 @@ import org.apache.log4j.Logger;
 import org.bouncycastle.util.encoders.Base64;
 
 import com.cloud.domain.Domain;
-import com.cloud.exception.*;
+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.user.AccountService;
 import com.cloud.user.DomainService;
 
@@ -175,7 +186,7 @@ public class LdapImportUsersCmd extends BaseListCmd {
             final SecureRandom randomGen = SecureRandom.getInstance("SHA1PRNG");
             final byte bytes[] = new byte[20];
             randomGen.nextBytes(bytes);
-            return Base64.encode(bytes).toString();
+            return Arrays.toString(Base64.encode(bytes));
         } catch (final NoSuchAlgorithmException e) {
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to generate random password");
         }