From 0cf15fcad00c5eeb9df92185fc3496ca9b3a689a Mon Sep 17 00:00:00 2001 From: Hyeon Sung Date: Wed, 24 Apr 2024 09:14:55 +0900 Subject: [PATCH 1/2] Remove unnecessary nesting of calls to String.format See gh-40494 --- .../springframework/boot/maven/MavenBuildOutputTimestamp.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/MavenBuildOutputTimestamp.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/MavenBuildOutputTimestamp.java index 702677bba98..5ddb8274375 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/MavenBuildOutputTimestamp.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/MavenBuildOutputTimestamp.java @@ -91,8 +91,7 @@ class MavenBuildOutputTimestamp { .truncatedTo(ChronoUnit.SECONDS) .toInstant(); if (instant.isBefore(DATE_MIN) || instant.isAfter(DATE_MAX)) { - throw new IllegalArgumentException(String - .format(String.format("'%s' is not within the valid range %s to %s", instant, DATE_MIN, DATE_MAX))); + throw new IllegalArgumentException(String.format("'%s' is not within the valid range %s to %s", instant, DATE_MIN, DATE_MAX)); } return instant; } From 2cb19f368e14f694d30ec1cfd8caaf61385d16f7 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Wed, 24 Apr 2024 13:57:07 +0200 Subject: [PATCH 2/2] Polish "Remove unnecessary nesting of calls to String.format" See gh-40494 --- .../springframework/boot/maven/MavenBuildOutputTimestamp.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/MavenBuildOutputTimestamp.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/MavenBuildOutputTimestamp.java index 5ddb8274375..81f9dc32839 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/MavenBuildOutputTimestamp.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/MavenBuildOutputTimestamp.java @@ -91,7 +91,8 @@ class MavenBuildOutputTimestamp { .truncatedTo(ChronoUnit.SECONDS) .toInstant(); if (instant.isBefore(DATE_MIN) || instant.isAfter(DATE_MAX)) { - throw new IllegalArgumentException(String.format("'%s' is not within the valid range %s to %s", instant, DATE_MIN, DATE_MAX)); + throw new IllegalArgumentException( + String.format("'%s' is not within the valid range %s to %s", instant, DATE_MIN, DATE_MAX)); } return instant; }