Skip to content

Commit b1a0375

Browse files
committed
Adjust to blocking lower/uper-casing without locale.
1 parent da9cb76 commit b1a0375

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2022 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.util.ArrayList;
2020
import java.util.Collections;
2121
import java.util.List;
22+
import java.util.Locale;
2223

2324
import com.netflix.appinfo.InstanceInfo;
2425
import com.netflix.discovery.EurekaClient;
@@ -35,6 +36,7 @@
3536
*
3637
* @author Spencer Gibb
3738
* @author Tim Ysewyn
39+
* @author Olga Maciaszek-Sharma
3840
*/
3941
public class EurekaDiscoveryClient implements DiscoveryClient {
4042

@@ -79,7 +81,7 @@ public List<String> getServices() {
7981
if (app.getInstances().isEmpty()) {
8082
continue;
8183
}
82-
names.add(app.getName().toLowerCase());
84+
names.add(app.getName().toLowerCase(Locale.ROOT));
8385

8486
}
8587
return names;

spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/EurekaServerConfigBean.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.Arrays;
2020
import java.util.Collections;
2121
import java.util.HashMap;
22+
import java.util.Locale;
2223
import java.util.Map;
2324
import java.util.Objects;
2425
import java.util.Set;
@@ -234,7 +235,8 @@ public boolean shouldGZipContentFromRemoteRegion() {
234235

235236
@Override
236237
public Set<String> getRemoteRegionAppWhitelist(String regionName) {
237-
return this.remoteRegionAppWhitelist.get(regionName == null ? "global" : regionName.trim().toLowerCase());
238+
return this.remoteRegionAppWhitelist
239+
.get(regionName == null ? "global" : regionName.trim().toLowerCase(Locale.ROOT));
238240
}
239241

240242
@Override

src/checkstyle/checkstyle-suppressions.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@
1414
<suppress files=".*TestAutoConfiguration\.java" checks="JavadocStyle"/>
1515
<suppress files=".*Tests\.java" checks="JavadocVariable"/>
1616
<suppress files=".*EurekaConfigServerBootstrapperIT\.java" checks="JavadocVariable"/>
17+
<suppress files="[\\/]src[\\/](test|testFixtures)[\\/](java|java21)[\\/]"
18+
checks="RegexpSinglelineJava" id="toLowerCaseWithoutLocale"/>
19+
<suppress files="[\\/]src[\\/](test|testFixtures)[\\/](java|java21)[\\/]"
20+
checks="RegexpSinglelineJava" id="toUpperCaseWithoutLocale"/>
1721
</suppressions>

0 commit comments

Comments
 (0)