From b06e7e60f9152d0d323884818d8c9a9243310051 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 30 Jun 2023 14:38:31 +0100 Subject: [PATCH] Polish "Fix asymmetry of equals when element has trailing dashes" See gh-34804 --- .../source/ConfigurationPropertyName.java | 19 +++++++++++++++++-- .../ConfigurationPropertyNameTests.java | 15 +++++++-------- 2 files changed, 24 insertions(+), 10 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 a1a3d6b7b1..6713e2f2a1 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -406,7 +406,7 @@ public final class ConfigurationPropertyName implements Comparable= l2) { - return remainderIsNotAlphanumeric(e1, i, i1); + return remainderIsDashes(e1, i, i1); } char ch1 = e1.charAt(i, i1); char ch2 = e2.charAt(i, i2); @@ -487,6 +487,21 @@ public final class ConfigurationPropertyName implements Comparable