From 016a4c4260ee882807be51df89870e1bc7726485 Mon Sep 17 00:00:00 2001 From: Mengqi Xu <2663479778@qq.com> Date: Tue, 21 Jan 2025 22:53:18 +0800 Subject: [PATCH 1/2] Improve Javadoc for SpringProperties.getFlag() getFlag() returns true when the property is equal, ignoring case, to the string "true", not just "true"; "TrUe" also means true. Closes gh-34295 Signed-off-by: Mengqi Xu <2663479778@qq.com> --- .../main/java/org/springframework/core/SpringProperties.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/core/SpringProperties.java b/spring-core/src/main/java/org/springframework/core/SpringProperties.java index e82c371a191..32ff66e1fb9 100644 --- a/spring-core/src/main/java/org/springframework/core/SpringProperties.java +++ b/spring-core/src/main/java/org/springframework/core/SpringProperties.java @@ -123,7 +123,7 @@ public final class SpringProperties { /** * Retrieve the flag for the given property key. * @param key the property key - * @return {@code true} if the property is set to "true", + * @return {@code true} if the property is not {@code null} and is equal, ignoring case, to the string "true", * {@code} false otherwise */ public static boolean getFlag(String key) { From 6863b904b56993020debfec8b127f241baae074d Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:21:36 +0100 Subject: [PATCH 2/2] Polish contribution See gh-34295 --- .../java/org/springframework/core/SpringProperties.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/SpringProperties.java b/spring-core/src/main/java/org/springframework/core/SpringProperties.java index 32ff66e1fb9..299ec0d987b 100644 --- a/spring-core/src/main/java/org/springframework/core/SpringProperties.java +++ b/spring-core/src/main/java/org/springframework/core/SpringProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2025 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. @@ -123,8 +123,8 @@ public final class SpringProperties { /** * Retrieve the flag for the given property key. * @param key the property key - * @return {@code true} if the property is not {@code null} and is equal, ignoring case, to the string "true", - * {@code} false otherwise + * @return {@code true} if the property is set to the string "true" + * (ignoring case), {@code} false otherwise */ public static boolean getFlag(String key) { return Boolean.parseBoolean(getProperty(key));