Update Gson.java documentation to explicitly state behavior for empty strings (#1464)

This commit is contained in:
Márton Braun 2019-02-17 09:32:43 +01:00 committed by inder123
parent da5cae371e
commit 4d942db168

View File

@ -832,7 +832,8 @@ public final class Gson {
* <pre> * <pre>
* Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType(); * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
* </pre> * </pre>
* @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 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 * @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 * @param json the root of the parse tree of {@link JsonElement}s from which the object is to
* be deserialized * be deserialized
* @param classOfT The class of T * @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 * @throws JsonSyntaxException if json is not a valid representation for an object of type typeOfT
* @since 1.3 * @since 1.3
*/ */
@ -988,7 +990,8 @@ public final class Gson {
* <pre> * <pre>
* Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType(); * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
* </pre> * </pre>
* @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 * @throws JsonSyntaxException if json is not a valid representation for an object of type typeOfT
* @since 1.3 * @since 1.3
*/ */