From 1c4c0c6119f9a3c24910d980d93d9eb1790b8893 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Thu, 6 Oct 2016 22:08:14 +0900 Subject: [PATCH] Fix String.format() usages Closes gh-7120 --- .../websocket/WebSocketMessagingAutoConfigurationTests.java | 2 +- .../org/springframework/boot/bind/YamlConfigurationFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/WebSocketMessagingAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/WebSocketMessagingAutoConfigurationTests.java index 0c98e465bd..33e1f4061b 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/WebSocketMessagingAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/WebSocketMessagingAutoConfigurationTests.java @@ -106,7 +106,7 @@ public class WebSocketMessagingAutoConfigurationTests { @Test public void basicMessagingWithStringResponse() throws Throwable { Object result = performStompSubscription("/app/string"); - assertThat(new String((byte[]) result)).isEqualTo(String.format("string data")); + assertThat(new String((byte[]) result)).isEqualTo("string data"); } @Test diff --git a/spring-boot/src/main/java/org/springframework/boot/bind/YamlConfigurationFactory.java b/spring-boot/src/main/java/org/springframework/boot/bind/YamlConfigurationFactory.java index 3414b90e8d..6ab2e551ea 100644 --- a/spring-boot/src/main/java/org/springframework/boot/bind/YamlConfigurationFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/bind/YamlConfigurationFactory.java @@ -138,7 +138,7 @@ public class YamlConfigurationFactory + "either set it directly or set the resource to load it from"); try { if (this.logger.isTraceEnabled()) { - this.logger.trace(String.format("Yaml document is %n%s" + this.yaml)); + this.logger.trace(String.format("Yaml document is %n%s", this.yaml)); } Constructor constructor = new YamlJavaBeanPropertyConstructor(this.type, this.propertyAliases);