From 1c7507ed6d482d17e908254da03a85e4463f14e2 Mon Sep 17 00:00:00 2001 From: Shershah03 Date: Thu, 6 Mar 2025 00:44:43 +0530 Subject: [PATCH] [Issue-2816] - Update exception type in JsonDeserializer to JsonSyntaxException --- gson/src/main/java/com/google/gson/JsonDeserializer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gson/src/main/java/com/google/gson/JsonDeserializer.java b/gson/src/main/java/com/google/gson/JsonDeserializer.java index 7c83b63e0e..950a5212ab 100644 --- a/gson/src/main/java/com/google/gson/JsonDeserializer.java +++ b/gson/src/main/java/com/google/gson/JsonDeserializer.java @@ -49,7 +49,7 @@ *
  * class IdDeserializer implements JsonDeserializer<Id> {
  *   public Id deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
- *       throws JsonParseException {
+ *       throws JsonSyntaxException {
  *     long idValue = json.getAsJsonPrimitive().getAsLong();
  *     return new Id((Class) typeOfT, idValue);
  *   }
@@ -88,8 +88,8 @@ public interface JsonDeserializer {
    * @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;
 }