Optimize thread safe code and replace the synchronized class "StringBuffer" by an unsynchronized one "StringBuilder". (#2704)

This commit is contained in:
Igor Suhorukov
2018-02-05 04:09:09 +03:00
committed by Ryan Baxter
parent 07411bba40
commit 076df77563
4 changed files with 5 additions and 5 deletions

View File

@@ -70,7 +70,7 @@ public class EurekaDashboardProperties {
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("EurekaDashboardProperties{");
final StringBuilder sb = new StringBuilder("EurekaDashboardProperties{");
sb.append("path='").append(path).append('\'');
sb.append(", enabled=").append(enabled);
sb.append('}');

View File

@@ -201,7 +201,7 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("RibbonServer{");
final StringBuilder sb = new StringBuilder("RibbonServer{");
sb.append("serviceId='").append(serviceId).append('\'');
sb.append(", server=").append(server);
sb.append(", secure=").append(secure);

View File

@@ -198,7 +198,7 @@ public class RibbonCommandContext {
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("RibbonCommandContext{");
final StringBuilder sb = new StringBuilder("RibbonCommandContext{");
sb.append("serviceId='").append(serviceId).append('\'');
sb.append(", method='").append(method).append('\'');
sb.append(", uri='").append(uri).append('\'');

View File

@@ -529,7 +529,7 @@ public class ZuulProperties {
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("Host{");
final StringBuilder sb = new StringBuilder("Host{");
sb.append("maxTotalConnections=").append(maxTotalConnections);
sb.append(", maxPerRouteConnections=").append(maxPerRouteConnections);
sb.append(", socketTimeoutMillis=").append(socketTimeoutMillis);
@@ -576,7 +576,7 @@ public class ZuulProperties {
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("HystrixSemaphore{");
final StringBuilder sb = new StringBuilder("HystrixSemaphore{");
sb.append("maxSemaphores=").append(maxSemaphores);
sb.append('}');
return sb.toString();