Skip to content

Commit 7a3b0b1

Browse files
committed
Fixed #1120
1 parent 2d90441 commit 7a3b0b1

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

release-notes/CREDITS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ Benson Margulies:
143143
(2.4.4)
144144
* Contributed 944: Failure to use custom deserializer for key deserializer
145145
(2.6.3)
146+
* Reported #1120: String value omitted from weirdStringException
147+
(2.6.6)
146148

147149
Steve Sanbeg: (sanbeg@github)
148150
* Contributed #482: Make date parsing error behavior consistent with JDK

release-notes/VERSION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Project: jackson-databind
1414
(reported by jefferyyuan@github)
1515
#1112: Detailed error message from custom key deserializer is discarded
1616
(contributed by Benson M)
17+
#1120: String value omitted from weirdStringException
18+
(reported by Benson M)
1719
#1123: Serializing and Deserializing Locale.ROOT
1820
(reported by hookumsnivy@github)
1921

src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ public JsonMappingException instantiationException(Class<?> instClass, String ms
906906
public JsonMappingException weirdStringException(String value, Class<?> instClass, String msg) {
907907
return InvalidFormatException.from(_parser,
908908
String.format("Can not construct instance of %s from String value '%s': %s",
909-
instClass.getName(), _valueDesc(), msg),
909+
instClass.getName(), _desc(value), msg),
910910
value, instClass);
911911
}
912912

@@ -917,10 +917,10 @@ public JsonMappingException weirdStringException(String value, Class<?> instClas
917917
public JsonMappingException weirdNumberException(Number value, Class<?> instClass, String msg) {
918918
return InvalidFormatException.from(_parser,
919919
String.format("Can not construct instance of %s from number value (%s): %s",
920-
instClass.getName(), _valueDesc(), msg),
920+
instClass.getName(), String.valueOf(value), msg),
921921
null, instClass);
922922
}
923-
923+
924924
/**
925925
* Helper method for constructing exception to indicate that given JSON
926926
* Object field name was not in format to be able to deserialize specified
@@ -1009,7 +1009,7 @@ protected String _calcName(Class<?> cls) {
10091009
}
10101010
return cls.getName();
10111011
}
1012-
1012+
10131013
protected String _valueDesc() {
10141014
try {
10151015
return _desc(_parser.getText());

0 commit comments

Comments
 (0)