From 9fedfc80669f9928df4adcc752ddbea03a40542d Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Sun, 12 Apr 2015 14:29:18 -0400 Subject: [PATCH] Switch types to be final. --- moshi/src/main/java/com/squareup/moshi/ArrayJsonAdapter.java | 2 +- moshi/src/main/java/com/squareup/moshi/JsonReader.java | 2 +- moshi/src/main/java/com/squareup/moshi/JsonWriter.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moshi/src/main/java/com/squareup/moshi/ArrayJsonAdapter.java b/moshi/src/main/java/com/squareup/moshi/ArrayJsonAdapter.java index a05da0b..aaae560 100644 --- a/moshi/src/main/java/com/squareup/moshi/ArrayJsonAdapter.java +++ b/moshi/src/main/java/com/squareup/moshi/ArrayJsonAdapter.java @@ -26,7 +26,7 @@ import java.util.List; * Converts arrays to JSON arrays containing their converted contents. This * supports both primitive and object arrays. */ -class ArrayJsonAdapter extends JsonAdapter { +final class ArrayJsonAdapter extends JsonAdapter { public static final Factory FACTORY = new Factory() { @Override public JsonAdapter create(Type type, AnnotatedElement annotations, Moshi moshi) { Type elementType = Types.arrayComponentType(type); diff --git a/moshi/src/main/java/com/squareup/moshi/JsonReader.java b/moshi/src/main/java/com/squareup/moshi/JsonReader.java index 01b5d00..957bcaf 100644 --- a/moshi/src/main/java/com/squareup/moshi/JsonReader.java +++ b/moshi/src/main/java/com/squareup/moshi/JsonReader.java @@ -173,7 +173,7 @@ import okio.Source; *

Each {@code JsonReader} may be used to read a single JSON stream. Instances * of this class are not thread safe. */ -public class JsonReader implements Closeable { +public final class JsonReader implements Closeable { private static final long MIN_INCOMPLETE_INTEGER = Long.MIN_VALUE / 10; private static final ByteString SINGLE_QUOTE_OR_SLASH = ByteString.encodeUtf8("'\\"); diff --git a/moshi/src/main/java/com/squareup/moshi/JsonWriter.java b/moshi/src/main/java/com/squareup/moshi/JsonWriter.java index 4d6ed52..86da482 100644 --- a/moshi/src/main/java/com/squareup/moshi/JsonWriter.java +++ b/moshi/src/main/java/com/squareup/moshi/JsonWriter.java @@ -124,7 +124,7 @@ import static com.squareup.moshi.JsonScope.NONEMPTY_OBJECT; * Instances of this class are not thread safe. Calls that would result in a * malformed JSON string will fail with an {@link IllegalStateException}. */ -public class JsonWriter implements Closeable, Flushable { +public final class JsonWriter implements Closeable, Flushable { /* * From RFC 4627, "All Unicode characters may be placed within the