mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 07:59:21 +08:00
Merge pull request #249 from square/jwilson.0203.dont_mispel
Fix a typo in the name of JsonUtf8Writer.
This commit is contained in:
@@ -422,7 +422,7 @@ public abstract class JsonReader implements Closeable {
|
||||
ByteString[] result = new ByteString[strings.length];
|
||||
Buffer buffer = new Buffer();
|
||||
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).
|
||||
result[i] = buffer.readByteString();
|
||||
}
|
||||
|
@@ -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_OBJECT;
|
||||
|
||||
final class JsonUt8Writer extends JsonWriter {
|
||||
final class JsonUtf8Writer extends JsonWriter {
|
||||
|
||||
/*
|
||||
* From RFC 7159, "All Unicode characters may be placed within the
|
||||
@@ -62,7 +62,7 @@ final class JsonUt8Writer extends JsonWriter {
|
||||
|
||||
private String deferredName;
|
||||
|
||||
JsonUt8Writer(BufferedSink sink) {
|
||||
JsonUtf8Writer(BufferedSink sink) {
|
||||
if (sink == null) {
|
||||
throw new NullPointerException("sink == null");
|
||||
}
|
@@ -138,7 +138,7 @@ public abstract class JsonWriter implements Closeable, Flushable {
|
||||
|
||||
/** Returns a new instance that writes UTF-8 encoded JSON to {@code sink}. */
|
||||
public static JsonWriter of(BufferedSink sink) {
|
||||
return new JsonUt8Writer(sink);
|
||||
return new JsonUtf8Writer(sink);
|
||||
}
|
||||
|
||||
JsonWriter() {
|
||||
|
@@ -35,7 +35,7 @@ abstract class JsonCodecFactory {
|
||||
|
||||
@Override JsonWriter newWriter() {
|
||||
buffer = new Buffer();
|
||||
return new JsonUt8Writer(buffer);
|
||||
return new JsonUtf8Writer(buffer);
|
||||
}
|
||||
|
||||
@Override String json() {
|
||||
|
@@ -21,7 +21,7 @@ import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public final class JsonUt8WriterTest {
|
||||
public final class JsonUtf8WriterTest {
|
||||
@Test public void prettyPrintObject() throws IOException {
|
||||
Buffer buffer = new Buffer();
|
||||
JsonWriter writer = JsonWriter.of(buffer);
|
Reference in New Issue
Block a user