From b9589203dc7d05291eafa4b5f18de5b188967da1 Mon Sep 17 00:00:00 2001 From: Piyal Ahmed Date: Fri, 4 Jul 2025 22:20:06 +0800 Subject: [PATCH] Polish Signed-off-by: Piyal Ahmed See gh-46291 --- .../boot/actuate/management/HeapDumpWebEndpoint.java | 5 +---- .../springframework/boot/loader/net/util/UrlDecoder.java | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java index 10436b2f9f2..3cfbf45acc9 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java @@ -125,10 +125,7 @@ public class HeapDumpWebEndpoint { return true; } String vmVendor = System.getProperty("java.vm.vendor"); - if (StringUtils.hasLength(vmVendor) && vmVendor.toLowerCase(Locale.ROOT).contains("openj9")) { - return true; - } - return false; + return StringUtils.hasLength(vmVendor) && vmVendor.toLowerCase(Locale.ROOT).contains("openj9"); } /** diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/util/UrlDecoder.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/util/UrlDecoder.java index 575a30f8548..f455a49a273 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/util/UrlDecoder.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/util/UrlDecoder.java @@ -73,13 +73,11 @@ public final class UrlDecoder { private static int fillByteBuffer(ByteBuffer byteBuffer, String string, int index, int length) { byteBuffer.clear(); - while (true) { + do { byteBuffer.put(unescape(string, index)); index += 3; - if (index >= length || string.charAt(index) != '%') { - break; - } } + while (index < length && string.charAt(index) == '%'); byteBuffer.flip(); return index; }