Merge pull request #737 from square/eric.CheckReturnValue-writer

Add CheckReturnValue annotation to beginFlatten.
This commit is contained in:
Jake Wharton
2018-11-06 11:06:02 -08:00
committed by GitHub

View File

@@ -445,7 +445,7 @@ public abstract class JsonWriter implements Closeable, Flushable {
* <p>This method returns an opaque token. Callers must match all calls to this method with a call * <p>This method returns an opaque token. Callers must match all calls to this method with a call
* to {@link #endFlatten} with the matching token. * to {@link #endFlatten} with the matching token.
*/ */
public final int beginFlatten() { @CheckReturnValue public final int beginFlatten() {
int context = peekScope(); int context = peekScope();
if (context != NONEMPTY_OBJECT && context != EMPTY_OBJECT if (context != NONEMPTY_OBJECT && context != EMPTY_OBJECT
&& context != NONEMPTY_ARRAY && context != EMPTY_ARRAY) { && context != NONEMPTY_ARRAY && context != EMPTY_ARRAY) {