Skip to content

Commit

Permalink
Fix #3906
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jul 25, 2023
1 parent 035fba3 commit 75d0c46
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
13 changes: 8 additions & 5 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -1102,20 +1102,23 @@ Tobias Preuss (johnjohndoe@github)
(2.10.3)

Eduard Tudenhöfner (nastra@github)
* Reported #2602, contributed fix for: ByteBufferSerializer produces unexpected results with
a duplicated ByteBuffer and a position > 0
* Reported #2602, contributed fix for: ByteBufferSerializer produces unexpected results with
a duplicated ByteBuffer and a position > 0
(2.10.3)

Alexander Shilov (ashlanderr@github)
* Reported, suggested fix for #2610: `EXTERNAL_PROPERTY` doesn't work with `@JsonIgnoreProperties`
* Reported, suggested fix for #2610: `EXTERNAL_PROPERTY` doesn't work with `@JsonIgnoreProperties`
(2.10.3)
Endre Stølsvik (stolsvik@github)
* Reported #2679: `ObjectMapper.readValue("123", Void.TYPE)` throws "should never occur"
* Reported #2679: `ObjectMapper.readValue("123", Void.TYPE)` throws "should never occur"
(2.10.4)
* Reported #3906: Regression: 2.15.0 breaks deserialization for records when
`mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE)`
(2.16.0)
Denis Kostousov (kostousov-ds@github)
* Reported #2787 (partial fix): NPE after add mixin for enum
* Reported #2787 (partial fix): NPE after add mixin for enum
(2.10.5)
Máté Rédecsi (rmatesz@github)
Expand Down
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Project: jackson-databind
#3877: Add new `OptBoolean` valued property in `@JsonTypeInfo`, handling,
to allow per-polymorphic type loose Type Id handling
(contributed by Joo-Hyuk K)
#3906: Regression: 2.15.0 breaks deserialization for records when
`mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE)`
(reported by Endre S)
#3924: Incorrect target type when disabling coercion, trying to deserialize
String from Array/Object
(reported by João G)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,14 @@ public final VisibilityChecker<?> getDefaultVisibilityChecker(Class<?> baseType,
vc = VisibilityChecker.Std.allPublicInstance();
} else {
vc = getDefaultVisibilityChecker();
// 20-May-2023, tatu: [databind#3906] Must reset visibility for Records
// to avoid hiding Constructors.
if (ClassUtil.isRecordType(baseType)) {
// But only if creator auto-detection enabled:
if (isEnabled(MapperFeature.AUTO_DETECT_CREATORS)) {
vc = vc.withCreatorVisibility(Visibility.NON_PRIVATE);
}
}
}
AnnotationIntrospector intr = getAnnotationIntrospector();
if (intr != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.databind.failing;
package com.fasterxml.jackson.databind.records;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
Expand Down

0 comments on commit 75d0c46

Please sign in to comment.