Merge pull request #249 from square/jwilson.0203.dont_mispel

Fix a typo in the name of JsonUtf8Writer.
This commit is contained in:
Jake Wharton
2017-02-03 13:06:56 -05:00
committed by GitHub
5 changed files with 6 additions and 6 deletions

View File

@@ -422,7 +422,7 @@ public abstract class JsonReader implements Closeable {
ByteString[] result = new ByteString[strings.length]; ByteString[] result = new ByteString[strings.length];
Buffer buffer = new Buffer(); Buffer buffer = new Buffer();
for (int i = 0; i < strings.length; i++) { for (int i = 0; i < strings.length; i++) {
JsonUt8Writer.string(buffer, strings[i]); JsonUtf8Writer.string(buffer, strings[i]);
buffer.readByte(); // Skip the leading double quote (but leave the trailing one). buffer.readByte(); // Skip the leading double quote (but leave the trailing one).
result[i] = buffer.readByteString(); result[i] = buffer.readByteString();
} }

View File

@@ -27,7 +27,7 @@ import static com.squareup.moshi.JsonScope.NONEMPTY_ARRAY;
import static com.squareup.moshi.JsonScope.NONEMPTY_DOCUMENT; import static com.squareup.moshi.JsonScope.NONEMPTY_DOCUMENT;
import static com.squareup.moshi.JsonScope.NONEMPTY_OBJECT; import static com.squareup.moshi.JsonScope.NONEMPTY_OBJECT;
final class JsonUt8Writer extends JsonWriter { final class JsonUtf8Writer extends JsonWriter {
/* /*
* From RFC 7159, "All Unicode characters may be placed within the * From RFC 7159, "All Unicode characters may be placed within the
@@ -62,7 +62,7 @@ final class JsonUt8Writer extends JsonWriter {
private String deferredName; private String deferredName;
JsonUt8Writer(BufferedSink sink) { JsonUtf8Writer(BufferedSink sink) {
if (sink == null) { if (sink == null) {
throw new NullPointerException("sink == null"); throw new NullPointerException("sink == null");
} }

View File

@@ -138,7 +138,7 @@ public abstract class JsonWriter implements Closeable, Flushable {
/** Returns a new instance that writes UTF-8 encoded JSON to {@code sink}. */ /** Returns a new instance that writes UTF-8 encoded JSON to {@code sink}. */
public static JsonWriter of(BufferedSink sink) { public static JsonWriter of(BufferedSink sink) {
return new JsonUt8Writer(sink); return new JsonUtf8Writer(sink);
} }
JsonWriter() { JsonWriter() {

View File

@@ -35,7 +35,7 @@ abstract class JsonCodecFactory {
@Override JsonWriter newWriter() { @Override JsonWriter newWriter() {
buffer = new Buffer(); buffer = new Buffer();
return new JsonUt8Writer(buffer); return new JsonUtf8Writer(buffer);
} }
@Override String json() { @Override String json() {

View File

@@ -21,7 +21,7 @@ import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
public final class JsonUt8WriterTest { public final class JsonUtf8WriterTest {
@Test public void prettyPrintObject() throws IOException { @Test public void prettyPrintObject() throws IOException {
Buffer buffer = new Buffer(); Buffer buffer = new Buffer();
JsonWriter writer = JsonWriter.of(buffer); JsonWriter writer = JsonWriter.of(buffer);