Delete some obsolete TODOs
This commit is contained in:
parent
796a381279
commit
d4a1e49e46
|
@ -87,7 +87,7 @@ public final class CollectionTypeAdapterFactory implements TypeAdapterFactory {
|
||||||
|
|
||||||
public void write(JsonWriter out, Collection<E> collection) throws IOException {
|
public void write(JsonWriter out, Collection<E> collection) throws IOException {
|
||||||
if (collection == null) {
|
if (collection == null) {
|
||||||
out.nullValue(); // TODO: better policy here?
|
out.nullValue();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,8 +153,7 @@ public final class ReflectiveTypeAdapterFactory implements TypeAdapterFactory {
|
||||||
this.boundFields = boundFields;
|
this.boundFields = boundFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override public T read(JsonReader in) throws IOException {
|
||||||
public T read(JsonReader in) throws IOException {
|
|
||||||
if (in.peek() == JsonToken.NULL) {
|
if (in.peek() == JsonToken.NULL) {
|
||||||
in.nextNull();
|
in.nextNull();
|
||||||
return null;
|
return null;
|
||||||
|
@ -162,15 +161,12 @@ public final class ReflectiveTypeAdapterFactory implements TypeAdapterFactory {
|
||||||
|
|
||||||
T instance = constructor.construct();
|
T instance = constructor.construct();
|
||||||
|
|
||||||
// TODO: null out the other fields?
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
in.beginObject();
|
in.beginObject();
|
||||||
while (in.hasNext()) {
|
while (in.hasNext()) {
|
||||||
String name = in.nextName();
|
String name = in.nextName();
|
||||||
BoundField field = boundFields.get(name);
|
BoundField field = boundFields.get(name);
|
||||||
if (field == null || !field.deserialized) {
|
if (field == null || !field.deserialized) {
|
||||||
// TODO: define a better policy
|
|
||||||
in.skipValue();
|
in.skipValue();
|
||||||
} else {
|
} else {
|
||||||
field.read(in, instance);
|
field.read(in, instance);
|
||||||
|
@ -185,10 +181,9 @@ public final class ReflectiveTypeAdapterFactory implements TypeAdapterFactory {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override public void write(JsonWriter out, T value) throws IOException {
|
||||||
public void write(JsonWriter out, T value) throws IOException {
|
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
out.nullValue(); // TODO: better policy here?
|
out.nullValue();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user