From 73d9e0e0edd75ecc74b74dcf7b1bf73c0170c000 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 23 Mar 2022 14:43:57 +0000 Subject: [PATCH] Fix equals when adapt removes trailing characters from element Closes gh-30317 --- .../source/ConfigurationPropertyName.java | 24 ++++++++++++------- .../ConfigurationPropertyNameTests.java | 9 +++++++ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java index dfaa435cf58..2a6fe30c35a 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java @@ -448,7 +448,7 @@ public final class ConfigurationPropertyName implements Comparable= l2) { - return false; + return remainderIsNotAlphaNumberic(e1, i, i1); } char ch1 = indexed1 ? e1.charAt(i, i1) : Character.toLowerCase(e1.charAt(i, i1)); char ch2 = indexed2 ? e2.charAt(i, i2) : Character.toLowerCase(e2.charAt(i, i2)); @@ -467,17 +467,23 @@ public final class ConfigurationPropertyName implements Comparable