diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java index 7bfff096a0b..9476b10244a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java @@ -72,14 +72,14 @@ class DefaultEndpointObjectNameFactory implements EndpointObjectNameFactory { throws MalformedObjectNameException { StringBuilder builder = new StringBuilder(this.properties.getDomain()); builder.append(":type=Endpoint"); - builder.append(",name=" + StringUtils.capitalize(endpoint.getId())); + builder.append(",name=").append(StringUtils.capitalize(endpoint.getId())); String baseName = builder.toString(); if (this.mBeanServer != null && hasMBean(baseName)) { - builder.append(",context=" + this.contextId); + builder.append(",context=").append(this.contextId); } if (this.uniqueNames) { String identity = ObjectUtils.getIdentityHexString(endpoint); - builder.append(",identity=" + identity); + builder.append(",identity=").append(identity); } builder.append(getStaticNames()); return ObjectNameManager.getInstance(builder.toString()); @@ -95,8 +95,8 @@ class DefaultEndpointObjectNameFactory implements EndpointObjectNameFactory { return ""; } StringBuilder builder = new StringBuilder(); - this.properties.getStaticNames() - .forEach((name, value) -> builder.append("," + name + "=" + value)); + this.properties.getStaticNames().forEach((name, value) -> builder.append(",") + .append(name).append("=").append(value)); return builder.toString(); }