Merge pull request #231 from serj-lotutovici/sl/small_or_nit

ObjectJsonReader.typeMismatch should return not throw.
This commit is contained in:
Jesse Wilson
2017-01-22 18:52:54 -05:00
committed by GitHub

View File

@@ -346,10 +346,10 @@ final class ObjectJsonReader extends JsonReader {
private JsonDataException typeMismatch(Object value, Object expected) { private JsonDataException typeMismatch(Object value, Object expected) {
if (value == null) { if (value == null) {
throw new JsonDataException( return new JsonDataException(
"Expected " + expected + " but was null at path " + getPath()); "Expected " + expected + " but was null at path " + getPath());
} else { } else {
throw new JsonDataException("Expected " + expected + " but was " + value + ", a " return new JsonDataException("Expected " + expected + " but was " + value + ", a "
+ value.getClass().getName() + ", at path " + getPath()); + value.getClass().getName() + ", at path " + getPath());
} }
} }