Skip to content

Remove GenericTypeIndicator in error messages #4268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2022
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
1 change: 1 addition & 0 deletions firebase-firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(#5871).

- [fixed] Fixed Firestore failing to raise initial snapshot from empty local cache result.
- [fixed] Removed invalid suggestions to use `GenericTypeIndicator` from error messages.

# 24.4.0
* [feature] Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,7 @@ private static <T> T deserializeToClass(Object o, Class<T> clazz, DeserializeCon
context.errorPath, "Converting to Arrays is not supported, please use Lists instead");
} else if (clazz.getTypeParameters().length > 0) {
throw deserializeError(
context.errorPath,
"Class "
+ clazz.getName()
+ " has generic type parameters, please use GenericTypeIndicator instead");
context.errorPath, "Class " + clazz.getName() + " has generic type parameters");
} else if (clazz.equals(Object.class)) {
return (T) o;
} else if (clazz.isEnum()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1883,16 +1883,14 @@ public void primitiveClassesCanBePassedInTopLevel() {
@Test
public void passingInListTopLevelThrows() {
assertExceptionContains(
"Class java.util.List has generic type parameters, please use GenericTypeIndicator "
+ "instead",
"Class java.util.List has generic type parameters",
() -> convertToCustomClass(Collections.singletonList("foo"), List.class));
}

@Test
public void passingInMapTopLevelThrows() {
assertExceptionContains(
"Class java.util.Map has generic type parameters, please use GenericTypeIndicator "
+ "instead",
"Class java.util.Map has generic type parameters",
() -> convertToCustomClass(Collections.singletonMap("foo", "bar"), Map.class));
}

Expand Down Expand Up @@ -1920,7 +1918,7 @@ public void passingInByteTopLevelThrows() {
public void passingInGenericBeanTopLevelThrows() {
assertExceptionContains(
"Class com.google.firebase.firestore.util.MapperTest$GenericBean has generic type "
+ "parameters, please use GenericTypeIndicator instead",
+ "parameters",
() -> deserialize("{'value': 'foo'}", GenericBean.class));
}

Expand Down