Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3487E10F8E for ; Mon, 3 Feb 2014 09:49:03 +0000 (UTC) Received: (qmail 31193 invoked by uid 500); 3 Feb 2014 09:49:02 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 30988 invoked by uid 500); 3 Feb 2014 09:49:01 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 30968 invoked by uid 99); 3 Feb 2014 09:48:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Feb 2014 09:48:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 428238C1900; Mon, 3 Feb 2014 09:48:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dahn@apache.org To: commits@cloudstack.apache.org Date: Mon, 03 Feb 2014 09:48:58 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated refs/heads/4.3-forward to 2513d6b Updated Branches: refs/heads/4.3-forward 92abb9439 -> 2513d6b91 Revert "findbugs replaced byte[].toString() with Arrays.toString(byte[])(cherry picked from commit ce7c6d23575d455a8273b77702a56b7bb419b37b)" This reverts commit 55ec8f3a2d8ae73ae1e20a806a8f8d0ee29fa274. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8e96111c Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8e96111c Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8e96111c Branch: refs/heads/4.3-forward Commit: 8e96111c5512e67b4fca2315bb73ed457791ce18 Parents: 92abb94 Author: Daan Hoogland Authored: Mon Feb 3 10:47:19 2014 +0100 Committer: Daan Hoogland Committed: Mon Feb 3 10:47:19 2014 +0100 ---------------------------------------------------------------------- .../api/command/LdapCreateAccountCmd.java | 3 +-- .../cloudstack/api/command/LdapImportUsersCmd.java | 17 +++-------------- 2 files changed, 4 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8e96111c/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 3afa22b..981e72e 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,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"); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8e96111c/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 41eacf0..1855d5d 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,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"); }