Skip to content

Commit 2b81b30

Browse files
committed
Move property-annotation-merging to a slightly later phase, hoping to resolve #1756
1 parent eb996aa commit 2b81b30

File tree

3 files changed

+8
-99
lines changed

3 files changed

+8
-99
lines changed

src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -317,17 +317,19 @@ protected void collectAll()
317317
// Remove ignored properties, first; this MUST precede annotation merging
318318
// since logic relies on knowing exactly which accessor has which annotation
319319
_removeUnwantedProperties(props);
320-
321-
// then merge annotations, to simplify further processing
322-
for (POJOPropertyBuilder property : props.values()) {
323-
property.mergeAnnotations(_forSerialization);
324-
}
325320
// and then remove unneeded accessors (wrt read-only, read-write)
326321
_removeUnwantedAccessor(props);
327322

328323
// Rename remaining properties
329324
_renameProperties(props);
330325

326+
// then merge annotations, to simplify further processing
327+
// 26-Sep-2017, tatu: Before 2.9.2 was done earlier but that prevented some of
328+
// annotations from getting properly merged
329+
for (POJOPropertyBuilder property : props.values()) {
330+
property.mergeAnnotations(_forSerialization);
331+
}
332+
331333
// And use custom naming strategy, if applicable...
332334
PropertyNamingStrategy naming = _findNamingStrategy();
333335
if (naming != null) {
@@ -348,7 +350,7 @@ protected void collectAll()
348350
if (_config.isEnabled(MapperFeature.USE_WRAPPER_NAME_AS_PROPERTY_NAME)) {
349351
_renameWithWrappers(props);
350352
}
351-
353+
352354
// well, almost last: there's still ordering...
353355
_sortProperties(props);
354356
_properties = props;

src/test/java/com/fasterxml/jackson/failing/EnumAsExternalPropertyId1328Test.java

-54
This file was deleted.

src/test/java/com/fasterxml/jackson/failing/EnumCreator1699Test.java

-39
This file was deleted.

0 commit comments

Comments
 (0)