File tree 3 files changed +10
-5
lines changed
main/java/tools/jackson/databind
test/java/tools/jackson/databind/objectid
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ Versions: 3.x (for earlier see VERSION-2.x)
57
57
#3601: Change `Optional` deserialization from "absent" value into `null`, from "empty"
58
58
#4160: Deprecate `DefaultTyping.EVERYTHING` in `2.x` and remove in `3.0`
59
59
#4381: Prevent construction of `null`-valued `JsonNode`s (like `TextNode`)
60
+ #4552: Change `MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS` default to `false` for 3.0
60
61
- Remove `MappingJsonFactory`
61
62
- Add context parameter for `TypeSerializer` contextualization (`forProperty()`)
62
63
- Default for `JsonNodeFeature.STRIP_TRAILING_BIGDECIMAL_ZEROES` changed to `false` for 3.0
Original file line number Diff line number Diff line change @@ -78,9 +78,9 @@ public enum MapperFeature
78
78
* rules; if disabled, such fields are NOT used as mutators except if
79
79
* explicitly annotated for such use.
80
80
*<p>
81
- * Feature is enabled by default, for backwards compatibility reasons .
81
+ * Feature is disabled by default in Jackson 3.x, in 2.x it was enabled by default .
82
82
*/
83
- ALLOW_FINAL_FIELDS_AS_MUTATORS (true ),
83
+ ALLOW_FINAL_FIELDS_AS_MUTATORS (false ),
84
84
85
85
/**
86
86
* Feature that determines whether member mutators (fields and
Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ public String result() {
37
37
38
38
@ JsonIdentityInfo (property = "id" , generator = ObjectIdGenerators .PropertyGenerator .class )
39
39
static class CreatorBased implements ResultGetter {
40
- private final String id ;
40
+ // NOTE: must NOT be `final` unless `MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS` enabled
41
+ private String id ;
41
42
42
43
@ JsonCreator
43
44
CreatorBased (@ JsonProperty (value = "id" ) String id ) {
@@ -66,7 +67,8 @@ public String result() {
66
67
67
68
@ JsonIdentityInfo (property = "id" , generator = ObjectIdGenerators .PropertyGenerator .class )
68
69
static class StaticFactoryMethodBased implements ResultGetter {
69
- private final String id ;
70
+ // NOTE: must NOT be `final` unless `MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS` enabled
71
+ private String id ;
70
72
71
73
private StaticFactoryMethodBased (String id ) {
72
74
this .id = id ;
@@ -89,7 +91,9 @@ public String result() {
89
91
90
92
@ JsonIdentityInfo (property = "id" , generator = ObjectIdGenerators .PropertyGenerator .class )
91
93
static class MultiArgConstructorBased implements ResultGetter {
92
- private final String id ;
94
+ // NOTE: must NOT be `final` unless `MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS` enabled
95
+ private String id ;
96
+
93
97
private final int value ;
94
98
95
99
@ JsonCreator
You can’t perform that action at this time.
0 commit comments