mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge pull request #16671 from izeye
* pr/16671: Polish defaultElementEquals Polish dashIgnoringElementEquals() Closes gh-16671
This commit is contained in:
commit
9ad19349f4
@ -360,11 +360,17 @@ public final class ConfigurationPropertyName
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
while (i2 < l2) {
|
||||
char ch2 = Character.toLowerCase(e2.charAt(i, i2++));
|
||||
if (indexed2 || ElementsParser.isAlphaNumeric(ch2)) {
|
||||
if (i2 < l2) {
|
||||
if (indexed2) {
|
||||
return false;
|
||||
}
|
||||
do {
|
||||
char ch2 = Character.toLowerCase(e2.charAt(i, i2++));
|
||||
if (ElementsParser.isAlphaNumeric(ch2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
while (i2 < l2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -394,12 +400,17 @@ public final class ConfigurationPropertyName
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
boolean indexed2 = e2.getType(i).isIndexed();
|
||||
while (i2 < l2) {
|
||||
char ch2 = e2.charAt(i, i2++);
|
||||
if (indexed2 || ch2 != '-') {
|
||||
if (i2 < l2) {
|
||||
if (e2.getType(i).isIndexed()) {
|
||||
return false;
|
||||
}
|
||||
do {
|
||||
char ch2 = e2.charAt(i, i2++);
|
||||
if (ch2 != '-') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
while (i2 < l2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -632,6 +632,7 @@ public class ConfigurationPropertyNameTests {
|
||||
ConfigurationPropertyName n2 = ConfigurationPropertyName
|
||||
.of("management.metrics.web.server.auto-time-requests");
|
||||
assertThat(n1).isNotEqualTo(n2);
|
||||
assertThat(n2).isNotEqualTo(n1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user