Skip to content

Commit a509ac2

Browse files
committed
Clean up changes
1 parent 0b30af1 commit a509ac2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,18 +1543,16 @@ protected TypeResolverBuilder<?> _findTypeResolver(MapperConfig<?> config,
15431543
// 13-Aug-2011, tatu: One complication; external id only works for properties;
15441544
// so if declared for a Class, we will need to map it to "PROPERTY"
15451545
// instead of "EXTERNAL_PROPERTY"
1546-
if (ann instanceof AnnotatedClass) {
1547-
JsonTypeInfo.As inclusion = typeInfo.getInclusionType();
1548-
if (inclusion == JsonTypeInfo.As.EXTERNAL_PROPERTY && (ann instanceof AnnotatedClass)) {
1549-
typeInfo = typeInfo.withInclusionType(JsonTypeInfo.As.PROPERTY);
1550-
}
1546+
JsonTypeInfo.As inclusion = typeInfo.getInclusionType();
1547+
if (inclusion == JsonTypeInfo.As.EXTERNAL_PROPERTY && (ann instanceof AnnotatedClass)) {
1548+
typeInfo = typeInfo.withInclusionType(JsonTypeInfo.As.PROPERTY);
15511549
}
1552-
1550+
Class<?> defaultImpl = typeInfo.getDefaultImpl();
1551+
15531552
// 08-Dec-2014, tatu: To deprecate `JsonTypeInfo.None` we need to use other placeholder(s);
15541553
// and since `java.util.Void` has other purpose (to indicate "deser as null"), we'll instead
15551554
// use `JsonTypeInfo.class` itself. But any annotation type will actually do, as they have no
15561555
// valid use (cannot instantiate as default)
1557-
Class<?> defaultImpl = typeInfo.getDefaultImpl();
15581556
if (defaultImpl != null && defaultImpl != JsonTypeInfo.None.class && !defaultImpl.isAnnotation()) {
15591557
typeInfo = typeInfo.withDefaultImpl(defaultImpl);
15601558
}

0 commit comments

Comments
 (0)