From 4d942db168c593ba86e46e2b26b026ff2b0d1018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Braun?= Date: Sun, 17 Feb 2019 09:32:43 +0100 Subject: [PATCH] Update Gson.java documentation to explicitly state behavior for empty strings (#1464) --- gson/src/main/java/com/google/gson/Gson.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gson/src/main/java/com/google/gson/Gson.java b/gson/src/main/java/com/google/gson/Gson.java index 0c455b2a..ba677e26 100644 --- a/gson/src/main/java/com/google/gson/Gson.java +++ b/gson/src/main/java/com/google/gson/Gson.java @@ -832,7 +832,8 @@ public final class Gson { *
    * Type typeOfT = new TypeToken<Collection<Foo>>(){}.getType();
    * 
- * @return an object of type T from the string. Returns {@code null} if {@code json} is {@code null}. + * @return an object of type T from the string. Returns {@code null} if {@code json} is {@code null} + * or if {@code json} is empty. * @throws JsonParseException if json is not a valid representation for an object of type typeOfT * @throws JsonSyntaxException if json is not a valid representation for an object of type */ @@ -965,7 +966,8 @@ public final class Gson { * @param json the root of the parse tree of {@link JsonElement}s from which the object is to * be deserialized * @param classOfT The class of T - * @return an object of type T from the json. Returns {@code null} if {@code json} is {@code null}. + * @return an object of type T from the json. Returns {@code null} if {@code json} is {@code null} + * or if {@code json} is empty. * @throws JsonSyntaxException if json is not a valid representation for an object of type typeOfT * @since 1.3 */ @@ -988,7 +990,8 @@ public final class Gson { *
    * Type typeOfT = new TypeToken<Collection<Foo>>(){}.getType();
    * 
- * @return an object of type T from the json. Returns {@code null} if {@code json} is {@code null}. + * @return an object of type T from the json. Returns {@code null} if {@code json} is {@code null} + * or if {@code json} is empty. * @throws JsonSyntaxException if json is not a valid representation for an object of type typeOfT * @since 1.3 */