Skip to content

Commit cb69a70

Browse files
committed
Fix #2378
1 parent 8f0d07d commit cb69a70

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

release-notes/CREDITS-2.x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,10 @@ Victor Noël (victornoel@github)
910910
* Reported #2339: Suboptimal return type for `ObjectNode.set()`
911911
(2.10.0)
912912

913+
David Harris (toadzky@github)
914+
* Reported #2378: `@JsonAlias` doesn't work with AutoValue
915+
(2.10.0)
916+
913917
Sam Smith (Oracle Security Researcher)
914918
* Suggested #2398: Replace recursion in `TokenBuffer.copyCurrentStructure()` with iteration
915919

release-notes/VERSION-2.x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Project: jackson-databind
1313
#2336: `MapDeserializer` can not merge `Map`s with polymorphic values
1414
(reported by Robert G)
1515
#2349: Add option `DefaultTyping.EVERYTHING` to support Kotlin data classes
16+
#2378: `@JsonAlias` doesn't work with AutoValue
17+
(reported by David H)
1618
#2390: `Iterable` serialization breaks when adding `@JsonFilter` annotation
1719
(reported by Chris M)
1820
#2392: `BeanDeserializerModifier.modifyDeserializer()` not applied to custom bean deserializers

src/main/java/com/fasterxml/jackson/databind/deser/impl/PropertyBasedCreator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ public static PropertyBasedCreator construct(DeserializationContext ctxt,
114114
}
115115
return new PropertyBasedCreator(ctxt, valueInstantiator, creatorProps,
116116
allProperties.isCaseInsensitive(),
117-
allProperties.hasAliases());
117+
// 05-Sep-2019, tatu: As per [databind#2378] looks like not all aliases get merged into
118+
// `allProperties` so force lookup anyway.
119+
// allProperties.hasAliases()
120+
true);
118121
}
119122

120123
/**

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ public List<PropertyName> findAliases(MapperConfig<?> config)
128128
if (aliases == null) {
129129
AnnotationIntrospector intr = config.getAnnotationIntrospector();
130130
if (intr != null) {
131-
aliases = intr.findPropertyAliases(getMember());
131+
final AnnotatedMember member = getMember();
132+
if (member != null) {
133+
aliases = intr.findPropertyAliases(member);
134+
}
132135
}
133136
if (aliases == null) {
134137
aliases = Collections.emptyList();

0 commit comments

Comments
 (0)