Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import io.polaris.core.storage.azure.AzureStorageConfigurationInfo;
import io.polaris.core.storage.gcp.GcpStorageConfigurationInfo;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
Expand Down Expand Up @@ -187,7 +188,7 @@ public static Optional<PolarisStorageConfigurationInfo> forEntityPath(

/** Validate if the provided allowed locations are valid for the storage type */
protected void validatePrefixForStorageType(String loc) {
if (!loc.toLowerCase().startsWith(storageType.prefix)) {
if (!loc.toLowerCase(Locale.ROOT).startsWith(storageType.prefix)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about introducing a modernizer, errorprone's StringCaseLocaleUsage rule or something to find this usage automatically?

throw new IllegalArgumentException(
String.format(
"Location prefix not allowed: '%s', expected prefix: '%s'", loc, storageType.prefix));
Expand Down