reduce object creation during JSON serialization
If a new {@code Double} instance is not required, this method
* should generally be used in preference to the constructor
* {@link #Double(double)}, as this method is likely to yield
* significantly better space and time performance by caching
* frequently requested values.
@@ -109,7 +109,7 @@ public class SerializationFilters {
@Override
public void serialize(Double arg0, JsonGenerator gen, SerializerProvider s)
throws IOException {
- if (new Double(arg0.longValue()).equals(arg0)) {
+ if (Double.valueOf(arg0.longValue()).equals(arg0)) {
gen.writeNumber(arg0.longValue());
} else {
gen.writeNumber(arg0);
