Skip to content
Merged
Show file tree
Hide file tree
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 @@ -332,11 +332,7 @@ public void fieldPathsMustNotHaveInvalidSegments() {
List<String> badFieldPaths =
asList("foo~bar", "foo*bar", "foo/bar", "foo[1", "foo]1", "foo[1]");
for (String fieldPath : badFieldPaths) {
String reason =
"Invalid field path ("
+ fieldPath
+ "). Paths must not contain '~', '*', '/', '[', or ']'";
verifyFieldPathThrows(fieldPath, reason);
verifyFieldPathThrows(fieldPath, "Use FieldPath.of() for field names containing '~*/[]'.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ public static FieldPath documentId() {
static FieldPath fromDotSeparatedPath(@NonNull String path) {
checkNotNull(path, "Provided field path must not be null.");
checkArgument(
!RESERVED.matcher(path).find(),
"Invalid field path (" + path + "). Paths must not contain '~', '*', '/', '[', or ']'");
!RESERVED.matcher(path).find(), "Use FieldPath.of() for field names containing '~*/[]'.");
try {
// By default, split() doesn't return empty leading and trailing segments. This can be enabled
// by passing "-1" as the limit.
Expand Down