From bd223e8bea65d7297edd22f9de6377caf5534632 Mon Sep 17 00:00:00 2001 From: choi-hyeseong Date: Sun, 22 Sep 2024 19:00:45 +0900 Subject: [PATCH 1/2] Remove duplicated `file.getName()` call Update `WebServerPortFileWriter` so that `file.getName()` is only called once. See gh-42411 --- .../web/context/WebServerPortFileWriter.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java index 0ec76343ebe..edc202fd31d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java @@ -109,18 +109,17 @@ public class WebServerPortFileWriter implements ApplicationListener Date: Sun, 22 Sep 2024 19:56:34 -0700 Subject: [PATCH 2/2] Polish 'Remove duplicated `file.getName()` call' See gh-42411 --- .../web/context/WebServerPortFileWriter.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java index edc202fd31d..bad6d0e4a79 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 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. @@ -108,18 +108,13 @@ public class WebServerPortFileWriter implements ApplicationListener