Skip to content

Commit e775f82

Browse files
committed
Fix Datastore - call to setNamespace fails under certain Locales #1957
Also checked other usages of String.format(), they seem ok. One potentially problematic place is com.google.cloud.testing.Version#toString(), but it is testing code.
1 parent db1af3c commit e775f82

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • google-cloud-datastore/src/main/java/com/google/cloud/datastore

google-cloud-datastore/src/main/java/com/google/cloud/datastore/Validator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class Validator {
3131
"([a-z\\d\\-]{1,100}~)?([a-z\\d][a-z\\d\\-\\.]{0,99}:)?([a-z\\d][a-z\\d\\-]{0,99})");
3232
private static final int MAX_NAMESPACE_LENGTH = 100;
3333
private static final Pattern NAMESPACE_PATTERN =
34-
Pattern.compile(String.format("[0-9A-Za-z\\._\\-]{0,%d}", MAX_NAMESPACE_LENGTH));
34+
Pattern.compile("[0-9A-Za-z\\._\\-]{0," + MAX_NAMESPACE_LENGTH + "}");
3535

3636
private Validator() {
3737
// utility class

0 commit comments

Comments
 (0)