Skip to content
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

[Issue-2816] - Update exception type in JsonDeserializer to JsonSyntaxException #2820

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions gson/src/main/java/com/google/gson/JsonDeserializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* <pre>
* class IdDeserializer implements JsonDeserializer&lt;Id&gt; {
* public Id deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
* throws JsonParseException {
* throws JsonSyntaxException {
* long idValue = json.getAsJsonPrimitive().getAsLong();
* return new Id((Class) typeOfT, idValue);
* }
Expand Down Expand Up @@ -88,8 +88,8 @@ public interface JsonDeserializer<T> {
* @param json The Json data being deserialized
* @param typeOfT The type of the Object to deserialize to
* @return a deserialized object of the specified type typeOfT which is a subclass of {@code T}
* @throws JsonParseException if json is not in the expected format of {@code typeOfT}
* @throws JsonSyntaxException if json is not in the expected format of {@code typeOfT}
*/
public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException;
throws JsonSyntaxException;
}