From 97c95d749e8795e2d06fe7168bf3cab3e12c3d48 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Thu, 22 Mar 2018 09:42:58 +0100 Subject: [PATCH 1/2] Avoid string copies in SpringBootBanner See gh-12591 --- .../java/org/springframework/boot/SpringBootBanner.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootBanner.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootBanner.java index ea66a7f5ca..0a772ec710 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootBanner.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootBanner.java @@ -50,14 +50,14 @@ class SpringBootBanner implements Banner { } String version = SpringBootVersion.getVersion(); version = (version == null ? "" : " (v" + version + ")"); - String padding = ""; + StringBuilder padding = new StringBuilder(); while (padding.length() < STRAP_LINE_SIZE - (version.length() + SPRING_BOOT.length())) { - padding += " "; + padding.append(" "); } printStream.println(AnsiOutput.toString(AnsiColor.GREEN, SPRING_BOOT, - AnsiColor.DEFAULT, padding, AnsiStyle.FAINT, version)); + AnsiColor.DEFAULT, padding.toString(), AnsiStyle.FAINT, version)); printStream.println(); } From ed7618b0977a06616c9d1955bde055a58671c276 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Sat, 24 Mar 2018 18:33:05 +0100 Subject: [PATCH 2/2] Polish "Avoid string copies in SpringBootBanner" Closes gh-12591 --- .../main/java/org/springframework/boot/SpringBootBanner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootBanner.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootBanner.java index 0a772ec710..8b144e2b79 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootBanner.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootBanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.