Merge pull request #512 from square/eric.moshi-docs

Fix up out-of-date comments.
This commit is contained in:
Jake Wharton
2018-04-27 10:27:03 -04:00
committed by GitHub

View File

@@ -77,8 +77,7 @@ final class JsonUtf8Reader extends JsonReader {
private long peekedLong; private long peekedLong;
/** /**
* The number of characters in a peeked number literal. Increment 'pos' by * The number of characters in a peeked number literal.
* this after reading a number.
*/ */
private int peekedNumberLength; private int peekedNumberLength;
@@ -564,7 +563,7 @@ final class JsonUtf8Reader extends JsonReader {
} }
/** /**
* If {@code name} is in {@code options} this consumes it and returns it's index. * If {@code name} is in {@code options} this consumes it and returns its index.
* Otherwise this returns -1 and no name is consumed. * Otherwise this returns -1 and no name is consumed.
*/ */
private int findName(String name, Options options) { private int findName(String name, Options options) {
@@ -639,7 +638,7 @@ final class JsonUtf8Reader extends JsonReader {
} }
/** /**
* If {@code string} is in {@code options} this consumes it and returns it's index. * If {@code string} is in {@code options} this consumes it and returns its index.
* Otherwise this returns -1 and no string is consumed. * Otherwise this returns -1 and no string is consumed.
*/ */
private int findString(String string, Options options) { private int findString(String string, Options options) {
@@ -751,7 +750,7 @@ final class JsonUtf8Reader extends JsonReader {
pathIndices[stackSize - 1]++; pathIndices[stackSize - 1]++;
return result; return result;
} catch (NumberFormatException ignored) { } catch (NumberFormatException ignored) {
// Fall back to parse as a double below. // Fall back to parse as a BigDecimal below.
} }
} else if (p != PEEKED_BUFFERED) { } else if (p != PEEKED_BUFFERED) {
throw new JsonDataException("Expected a long but was " + peek() throw new JsonDataException("Expected a long but was " + peek()
@@ -939,8 +938,7 @@ final class JsonUtf8Reader extends JsonReader {
/** /**
* Returns the next character in the stream that is neither whitespace nor a * Returns the next character in the stream that is neither whitespace nor a
* part of a comment. When this returns, the returned character is always at * part of a comment. When this returns, the returned character is always at
* {@code buffer[pos-1]}; this means the caller can always push back the * {@code buffer.getByte(0)}.
* returned character by decrementing {@code pos}.
*/ */
private int nextNonWhitespace(boolean throwOnEof) throws IOException { private int nextNonWhitespace(boolean throwOnEof) throws IOException {
/* /*