Improve error messages, remove JSON references
diff --git a/release-notes/VERSION b/release-notes/VERSION
index 8c482cb..eb4d84e 100644
--- a/release-notes/VERSION
+++ b/release-notes/VERSION
@@ -77,6 +77,8 @@
annotations
* It is now possible to serialize instances of plain old Object, iff
'FAIL_ON_EMPTY_BEANS' is disabled.
+* Trying to remove reference to "JSON" in datatype conversion errors
+ (since databinding is format-agnostic)
INCOMPATIBILITIES: (rats!)
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiator.java b/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiator.java
index d952af3..df463a4 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiator.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiator.java
@@ -212,31 +212,31 @@
public Object createFromString(DeserializationContext ctxt, String value)
throws IOException, JsonProcessingException {
throw new JsonMappingException("Can not instantiate value of type "
- +getValueTypeDesc()+" from JSON String");
+ +getValueTypeDesc()+" from String value");
}
public Object createFromInt(DeserializationContext ctxt, int value)
throws IOException, JsonProcessingException {
throw new JsonMappingException("Can not instantiate value of type "
- +getValueTypeDesc()+" from JSON int number");
+ +getValueTypeDesc()+" from Integer number (int)");
}
public Object createFromLong(DeserializationContext ctxt, long value)
throws IOException, JsonProcessingException {
throw new JsonMappingException("Can not instantiate value of type "
- +getValueTypeDesc()+" from JSON long number");
+ +getValueTypeDesc()+" from Integer number (long)");
}
public Object createFromDouble(DeserializationContext ctxt, double value)
throws IOException, JsonProcessingException {
throw new JsonMappingException("Can not instantiate value of type "
- +getValueTypeDesc()+" from JSON floating-point number");
+ +getValueTypeDesc()+" from Floating-point number (double)");
}
public Object createFromBoolean(DeserializationContext ctxt, boolean value)
throws IOException, JsonProcessingException {
throw new JsonMappingException("Can not instantiate value of type "
- +getValueTypeDesc()+" from JSON boolean value");
+ +getValueTypeDesc()+" from Boolean value");
}
/*
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdValueInstantiator.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdValueInstantiator.java
index e484150..b3b0d04 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdValueInstantiator.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdValueInstantiator.java
@@ -314,7 +314,7 @@
throw wrapException(e);
}
throw new JsonMappingException("Can not instantiate value of type "+getValueTypeDesc()
- +" from JSON integral number; no single-int-arg constructor/factory method");
+ +" from Integral number; no single-int-arg constructor/factory method");
}
@Override
@@ -331,7 +331,7 @@
throw wrapException(e);
}
throw new JsonMappingException("Can not instantiate value of type "+getValueTypeDesc()
- +" from JSON long integral number; no single-long-arg constructor/factory method");
+ +" from Long integral number; no single-long-arg constructor/factory method");
}
@Override
@@ -348,7 +348,7 @@
throw wrapException(e);
}
throw new JsonMappingException("Can not instantiate value of type "+getValueTypeDesc()
- +" from JSON floating-point number; no one-double/Double-arg constructor/factory method");
+ +" from Floating-point number; no one-double/Double-arg constructor/factory method");
}
@Override
@@ -365,7 +365,7 @@
throw wrapException(e);
}
throw new JsonMappingException("Can not instantiate value of type "+getValueTypeDesc()
- +" from JSON boolean value; no single-boolean/Boolean-arg constructor/factory method");
+ +" from Boolean value; no single-boolean/Boolean-arg constructor/factory method");
}
/*
@@ -417,7 +417,7 @@
return null;
}
throw new JsonMappingException("Can not instantiate value of type "+getValueTypeDesc()
- +" from JSON String; no single-String constructor/factory method");
+ +" from String value; no single-String constructor/factory method");
}
protected JsonMappingException wrapException(Throwable t)