All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.jackson.map.ser.BasicSerializerFactory.rej Maven / Gradle / Ivy

Go to download

Data Mapper package is a high-performance data binding package built on Jackson JSON processor

There is a newer version: 1.9.13
Show newest version
***************
*** 588,596 ****
              throws IOException, JsonGenerationException
          {
              // We'll have to use fallback "untyped" number write method
-             jgen.writeNumber(value.toString());
          }
  
          @Override
          public JsonNode getSchema(SerializerProvider provider, Type typeHint)
          {
--- 589,605 ----
              throws IOException, JsonGenerationException
          {
              // We'll have to use fallback "untyped" number write method
+         	if (jgen.isFeatureEnabled(Feature.QUOTE_NON_NUMERIC_NUMBERS) && isImaginary(value)) {
+         		jgen.writeString(value.toString());
+         	} else {
+         		jgen.writeNumber(value.toString());
+         	}
          }
  
+         private boolean isImaginary(Number value) {
+         	return (value instanceof Float && (((Float)value).isInfinite() || ((Float)value).isNaN())) 
+    		 		|| (value instanceof Double && (((Double)value).isInfinite() || ((Double)value).isNaN()));
+         }
          @Override
          public JsonNode getSchema(SerializerProvider provider, Type typeHint)
          {




© 2015 - 2025 Weber Informatics LLC | Privacy Policy