Deleted unneeded Long deserializer.
This commit is contained in:
parent
9db0c53217
commit
ba283925ae
@ -64,7 +64,6 @@ final class DefaultTypeAdapters {
|
|||||||
private static final MapTypeAdapter MAP_TYPE_ADAPTER = new MapTypeAdapter();
|
private static final MapTypeAdapter MAP_TYPE_ADAPTER = new MapTypeAdapter();
|
||||||
|
|
||||||
private static final CharacterTypeAdapter CHARACTER_TYPE_ADAPTER = new CharacterTypeAdapter();
|
private static final CharacterTypeAdapter CHARACTER_TYPE_ADAPTER = new CharacterTypeAdapter();
|
||||||
private static final LongDeserializer LONG_DESERIALIZER = new LongDeserializer();
|
|
||||||
private static final NumberTypeAdapter NUMBER_TYPE_ADAPTER = new NumberTypeAdapter();
|
private static final NumberTypeAdapter NUMBER_TYPE_ADAPTER = new NumberTypeAdapter();
|
||||||
|
|
||||||
private static final GregorianCalendarTypeAdapter GREGORIAN_CALENDAR_TYPE_ADAPTER =
|
private static final GregorianCalendarTypeAdapter GREGORIAN_CALENDAR_TYPE_ADAPTER =
|
||||||
@ -126,8 +125,6 @@ final class DefaultTypeAdapters {
|
|||||||
|
|
||||||
// Add primitive deserializers
|
// Add primitive deserializers
|
||||||
map.register(Character.class, wrapDeserializer(CHARACTER_TYPE_ADAPTER), true);
|
map.register(Character.class, wrapDeserializer(CHARACTER_TYPE_ADAPTER), true);
|
||||||
map.register(Long.class, LONG_DESERIALIZER, true);
|
|
||||||
map.register(long.class, LONG_DESERIALIZER, true);
|
|
||||||
map.register(Number.class, NUMBER_TYPE_ADAPTER, true);
|
map.register(Number.class, NUMBER_TYPE_ADAPTER, true);
|
||||||
|
|
||||||
map.makeUnmodifiable();
|
map.makeUnmodifiable();
|
||||||
@ -515,26 +512,6 @@ final class DefaultTypeAdapters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class LongDeserializer implements JsonDeserializer<Long> {
|
|
||||||
public Long deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
|
|
||||||
throws JsonParseException {
|
|
||||||
try {
|
|
||||||
return json.getAsLong();
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
throw new JsonSyntaxException(e);
|
|
||||||
} catch (UnsupportedOperationException e) {
|
|
||||||
throw new JsonSyntaxException(e);
|
|
||||||
} catch (IllegalStateException e) {
|
|
||||||
throw new JsonSyntaxException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return LongDeserializer.class.getSimpleName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static final class FloatSerializer implements JsonSerializer<Float> {
|
static final class FloatSerializer implements JsonSerializer<Float> {
|
||||||
private final boolean serializeSpecialFloatingPointValues;
|
private final boolean serializeSpecialFloatingPointValues;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user