ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [10/41] ambari git commit: AMBARI-19149. Code cleanup: StringBuffer
Date Thu, 06 Apr 2017 09:33:31 GMT
AMBARI-19149. Code cleanup: StringBuffer


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4f5ac096
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4f5ac096
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4f5ac096

Branch: refs/heads/branch-3.0-perf
Commit: 4f5ac0961ab7cec4c765299e9a7f90107ac85119
Parents: 9733808
Author: Attila Doroszlai <adoroszlai@hortonworks.com>
Authored: Mon Apr 3 14:22:05 2017 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Thu Apr 6 12:32:56 2017 +0300

----------------------------------------------------------------------
 .../java/org/apache/ambari/server/events/HostsRemovedEvent.java    | 2 +-
 .../ambari/server/security/encryption/CredentialProvider.java      | 2 +-
 .../apache/ambari/server/state/stack/StackRoleCommandOrder.java    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4f5ac096/ambari-server/src/main/java/org/apache/ambari/server/events/HostsRemovedEvent.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/HostsRemovedEvent.java
b/ambari-server/src/main/java/org/apache/ambari/server/events/HostsRemovedEvent.java
index 4145860..5d59b14 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/HostsRemovedEvent.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/HostsRemovedEvent.java
@@ -79,7 +79,7 @@ public class HostsRemovedEvent extends AmbariEvent {
    */
   @Override
   public String toString() {
-    final StringBuffer sb = new StringBuffer("HostsRemovedEvent{");
+    final StringBuilder sb = new StringBuilder("HostsRemovedEvent{");
     sb.append("m_clusters=").append(m_clusters);
     sb.append(", m_hosts=").append(m_hosts);
     sb.append('}');

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f5ac096/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java
index 0521aa1..de74ad0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/CredentialProvider.java
@@ -93,7 +93,7 @@ public class CredentialProvider {
   }
 
   private String generatePassword(int length) {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     Random r = new Random();
     for (int i = 0; i < length; i++) {
       sb.append(chars[r.nextInt(chars.length)]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/4f5ac096/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java
index 9f9ded6..5e245af 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java
@@ -152,7 +152,7 @@ public class StackRoleCommandOrder {
 		for (String depKey : deps.keySet()) {
 		  Object depValue = deps.get(depKey);
 		  if (depValue instanceof Collection) {
-			StringBuffer buffer = new StringBuffer();
+			StringBuilder buffer = new StringBuilder();
 			for (Object o : ((Collection) depValue)) {
 				if (buffer.length() > 0) {
           buffer.append(",");


Mime
View raw message