File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/main/java/com/fasterxml/jackson/databind/introspect Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1228,16 +1228,23 @@ public JsonPOJOBuilder.Value findPOJOBuilderConfig(AnnotatedClass ac)
1228
1228
public PropertyName findNameForDeserialization (Annotated a )
1229
1229
{
1230
1230
// @JsonSetter has precedence over @JsonProperty, being more specific
1231
- // @JsonDeserialize implies that there is a property, but no name
1231
+
1232
+ boolean useDefault = false ;
1232
1233
JsonSetter js = _findAnnotation (a , JsonSetter .class );
1233
1234
if (js != null ) {
1234
- return PropertyName .construct (js .value ());
1235
+ String s = js .value ();
1236
+ // 04-May-2018, tatu: Need to allow for "nameless" `@JsonSetter` too
1237
+ if (s .isEmpty ()) {
1238
+ useDefault = true ;
1239
+ } else {
1240
+ return PropertyName .construct (s );
1241
+ }
1235
1242
}
1236
1243
JsonProperty pann = _findAnnotation (a , JsonProperty .class );
1237
1244
if (pann != null ) {
1238
1245
return PropertyName .construct (pann .value ());
1239
1246
}
1240
- if (_hasOneOf (a , ANNOTATIONS_TO_INFER_DESER )) {
1247
+ if (useDefault || _hasOneOf (a , ANNOTATIONS_TO_INFER_DESER )) {
1241
1248
return PropertyName .USE_DEFAULT ;
1242
1249
}
1243
1250
return null ;
You can’t perform that action at this time.
0 commit comments