diff --git a/release-notes/VERSION b/release-notes/VERSION index 00bf8f8d37..ad90e39464 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -13,6 +13,8 @@ Project: jackson-databind (reported byb henryptung@github) #1807: Jackson-databind caches plain map deserializer and use it even map has `@JsonDeserializer` (reported by lexas2509@github) +#1843: Include name of unsettable property in exception from `SetterlessProperty.set()` + (suggested by andreh7@github) 2.9.2 (14-Oct-2017) diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/impl/ObjectIdReferenceProperty.java b/src/main/java/com/fasterxml/jackson/databind/deser/impl/ObjectIdReferenceProperty.java index e436180cc7..f1b62ab635 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/impl/ObjectIdReferenceProperty.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/impl/ObjectIdReferenceProperty.java @@ -93,7 +93,7 @@ public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, } catch (UnresolvedForwardReference reference) { boolean usingIdentityInfo = (_objectIdInfo != null) || (_valueDeserializer.getObjectIdReader() != null); if (!usingIdentityInfo) { - throw JsonMappingException.from(p, "Unresolved forward reference but no identity info.", reference); + throw JsonMappingException.from(p, "Unresolved forward reference but no identity info", reference); } reference.getRoid().appendReferring(new PropertyReferring(this, reference, _type.getRawClass(), instance)); return null; diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/impl/SetterlessProperty.java b/src/main/java/com/fasterxml/jackson/databind/deser/impl/SetterlessProperty.java index bc735891c3..2ce045b64a 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/impl/SetterlessProperty.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/impl/SetterlessProperty.java @@ -140,10 +140,10 @@ public Object deserializeSetAndReturn(JsonParser p, deserializeAndSet(p, ctxt, instance); return instance; } - + @Override public final void set(Object instance, Object value) throws IOException { - throw new UnsupportedOperationException("Should never call 'set' on setterless property"); + throw new UnsupportedOperationException("Should never call `set()` on setterless property ('"+getName()+"')"); } @Override