Skip to content

Commit d295931

Browse files
committed
Merge branch '2.x' into 3.0
2 parents f4c26a2 + 090c3ec commit d295931

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

src/main/java/tools/jackson/databind/deser/bean/PropertyBasedCreator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ public SettableBeanProperty findCreatorProperty(int propertyIndex) {
249249
*/
250250
public PropertyValueBuffer startBuilding(JsonParser p, DeserializationContext ctxt,
251251
ObjectIdReader oir) {
252-
return new PropertyValueBuffer(p, ctxt, _propertyCount, oir, null);
252+
return new PropertyValueBuffer(p, ctxt, _propertyCount, oir, null,
253+
_injectablePropIndexes);
253254
}
254255

255256
/**
@@ -260,7 +261,8 @@ public PropertyValueBuffer startBuilding(JsonParser p, DeserializationContext ct
260261
public PropertyValueBuffer startBuildingWithAnySetter(JsonParser p, DeserializationContext ctxt,
261262
ObjectIdReader oir, SettableAnyProperty anySetter
262263
) {
263-
return new PropertyValueBuffer(p, ctxt, _propertyCount, oir, anySetter);
264+
return new PropertyValueBuffer(p, ctxt, _propertyCount, oir, anySetter,
265+
_injectablePropIndexes);
264266
}
265267

266268
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer)

src/main/java/tools/jackson/databind/deser/bean/PropertyValueBuffer.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class PropertyValueBuffer
6969
/**
7070
* If we get non-creator parameters before or between
7171
* creator parameters, those need to be buffered. Buffer
72-
* is just a simple linked list
72+
* is just a simple linked list.
7373
*/
7474
protected PropertyValue _buffered;
7575

@@ -80,7 +80,7 @@ public class PropertyValueBuffer
8080
protected Object _idValue;
8181

8282
/**
83-
* "Any setter" property bound to a Creator parameter (via {@code @JsonAnySetter})
83+
* "Any setter" property bound to a Creator parameter (via {@code @JsonAnySetter}).
8484
*
8585
* @since 2.18
8686
*/
@@ -94,14 +94,25 @@ public class PropertyValueBuffer
9494
*/
9595
protected PropertyValue _anyParamBuffered;
9696

97+
/**
98+
* Indexes properties that are injectable, if any; {@code null} if none.
99+
*
100+
* @since 2.21
101+
*/
102+
protected final BitSet _injectablePropIndexes;
103+
97104
/*
98105
/**********************************************************************
99106
/* Life-cycle
100107
/**********************************************************************
101108
*/
102109

110+
/**
111+
* @since 3.1
112+
*/
103113
public PropertyValueBuffer(JsonParser p, DeserializationContext ctxt, int paramCount,
104-
ObjectIdReader oir, SettableAnyProperty anyParamSetter)
114+
ObjectIdReader oir, SettableAnyProperty anyParamSetter,
115+
BitSet injectablePropIndexes)
105116
{
106117
_parser = p;
107118
_context = ctxt;
@@ -119,6 +130,8 @@ public PropertyValueBuffer(JsonParser p, DeserializationContext ctxt, int paramC
119130
} else {
120131
_anyParamSetter = anyParamSetter;
121132
}
133+
_injectablePropIndexes = (injectablePropIndexes == null)
134+
? null : (BitSet) injectablePropIndexes.clone();
122135
}
123136

124137
/**

0 commit comments

Comments
 (0)