Skip to content

Commit fd2ff72

Browse files
committed
Add a missing override for IonAnnotationTypeResolverBuilder.withDefaultImpl()
1 parent 5655415 commit fd2ff72

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

ion/src/main/java/com/fasterxml/jackson/dataformat/ion/polymorphism/IonAnnotationTypeResolverBuilder.java

+22-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
2626
import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
2727
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
28+
import com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder;
29+
import com.fasterxml.jackson.databind.util.ClassUtil;
2830

2931
/**
3032
* A {@link TypeResolverBuilder} which produces {@link TypeSerializer}s and {@link TypeDeserializer}s that use
@@ -43,7 +45,18 @@ public class IonAnnotationTypeResolverBuilder
4345
/**
4446
* Whether type id should be exposed to deserializers or not
4547
*/
46-
private boolean typeIdVisible = false;
48+
private boolean typeIdVisible;
49+
50+
public IonAnnotationTypeResolverBuilder() {
51+
}
52+
53+
// @since 2.13.1
54+
protected IonAnnotationTypeResolverBuilder(IonAnnotationTypeResolverBuilder base,
55+
Class<?> defaultImpl) {
56+
typeIdResolver = base.typeIdResolver;
57+
typeIdVisible = base.typeIdVisible;
58+
this.defaultImpl = defaultImpl;
59+
}
4760

4861
@Override
4962
public Class<?> getDefaultImpl() {
@@ -108,4 +121,12 @@ public IonAnnotationTypeResolverBuilder typeIdVisibility(boolean isVisible) {
108121
typeIdVisible = isVisible;
109122
return this;
110123
}
124+
125+
@Override // @since 2.13.1
126+
public IonAnnotationTypeResolverBuilder withDefaultImpl(Class<?> newDefaultImpl) {
127+
if (newDefaultImpl == defaultImpl) {
128+
return this;
129+
}
130+
return new IonAnnotationTypeResolverBuilder(this, defaultImpl);
131+
}
111132
}

release-notes/VERSION-2.x

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Modules:
1010
=== Releases ===
1111
------------------------------------------------------------------------
1212

13+
2.13.1 (not yet released)
14+
15+
- (ion) Add missing `withDefaultImpl()` override for `IonAnnotationTypeResolverBuilder`
16+
1317
2.13.0 (30-Sep-2021)
1418

1519
#239: (cbor) Should validate UTF-8 multi-byte validity for short decode path too

0 commit comments

Comments
 (0)