Skip to content

Commit

Permalink
Adjust to blocking lower/uper-casing without locale.
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaMaciaszek committed Oct 17, 2024
1 parent da9cb76 commit b1a0375
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2024 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.
Expand All @@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;

import com.netflix.appinfo.InstanceInfo;
import com.netflix.discovery.EurekaClient;
Expand All @@ -35,6 +36,7 @@
*
* @author Spencer Gibb
* @author Tim Ysewyn
* @author Olga Maciaszek-Sharma
*/
public class EurekaDiscoveryClient implements DiscoveryClient {

Expand Down Expand Up @@ -79,7 +81,7 @@ public List<String> getServices() {
if (app.getInstances().isEmpty()) {
continue;
}
names.add(app.getName().toLowerCase());
names.add(app.getName().toLowerCase(Locale.ROOT));

}
return names;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
Expand Down Expand Up @@ -234,7 +235,8 @@ public boolean shouldGZipContentFromRemoteRegion() {

@Override
public Set<String> getRemoteRegionAppWhitelist(String regionName) {
return this.remoteRegionAppWhitelist.get(regionName == null ? "global" : regionName.trim().toLowerCase());
return this.remoteRegionAppWhitelist
.get(regionName == null ? "global" : regionName.trim().toLowerCase(Locale.ROOT));
}

@Override
Expand Down
4 changes: 4 additions & 0 deletions src/checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@
<suppress files=".*TestAutoConfiguration\.java" checks="JavadocStyle"/>
<suppress files=".*Tests\.java" checks="JavadocVariable"/>
<suppress files=".*EurekaConfigServerBootstrapperIT\.java" checks="JavadocVariable"/>
<suppress files="[\\/]src[\\/](test|testFixtures)[\\/](java|java21)[\\/]"
checks="RegexpSinglelineJava" id="toLowerCaseWithoutLocale"/>
<suppress files="[\\/]src[\\/](test|testFixtures)[\\/](java|java21)[\\/]"
checks="RegexpSinglelineJava" id="toUpperCaseWithoutLocale"/>
</suppressions>

0 comments on commit b1a0375

Please sign in to comment.