Skip to content

Commit

Permalink
Fix Datastore - call to setNamespace fails under certain Locales (#2037)
Browse files Browse the repository at this point in the history
#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.
  • Loading branch information
vam-google authored May 5, 2017
1 parent db1af3c commit d70f696
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class Validator {
"([a-z\\d\\-]{1,100}~)?([a-z\\d][a-z\\d\\-\\.]{0,99}:)?([a-z\\d][a-z\\d\\-]{0,99})");
private static final int MAX_NAMESPACE_LENGTH = 100;
private static final Pattern NAMESPACE_PATTERN =
Pattern.compile(String.format("[0-9A-Za-z\\._\\-]{0,%d}", MAX_NAMESPACE_LENGTH));
Pattern.compile("[0-9A-Za-z\\._\\-]{0," + MAX_NAMESPACE_LENGTH + "}");

private Validator() {
// utility class
Expand Down

0 comments on commit d70f696

Please sign in to comment.