Skip to content

Commit a0d5b30

Browse files
authored
Part 2 of prepping for #5151; minor change post #3072 (signature change) (#5155)
1 parent a6cb030 commit a0d5b30

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public final Object findInjectableValue(Object valueId,
478478
"No 'injectableValues' configured, cannot inject value with id '%s'", valueId),
479479
valueId, forProperty, beanInstance);
480480
}
481-
return _injectableValues.findInjectableValue(valueId, this, forProperty, beanInstance, optional);
481+
return _injectableValues.findInjectableValue(this, valueId, forProperty, beanInstance, optional);
482482
}
483483

484484
/**

src/main/java/com/fasterxml/jackson/databind/InjectableValues.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ public abstract class InjectableValues
1717
* (will be available when injected via field or setter; not available
1818
* when injected via constructor or factory method argument).
1919
*
20+
* @param ctxt Deserialization context
2021
* @param valueId Object that identifies value to inject; may be a simple
2122
* name or more complex identifier object, whatever provider needs
22-
* @param ctxt Deserialization context
2323
* @param forProperty Bean property in which value is to be injected
2424
* @param beanInstance Bean instance that contains property to inject,
2525
* if available; null if bean has not yet been constructed.
2626
* @param optional Flag used for configuring the behavior when the value
2727
* to inject is not found
2828
*/
29-
public Object findInjectableValue(Object valueId, DeserializationContext ctxt,
30-
BeanProperty forProperty, Object beanInstance, Boolean optional) throws JsonMappingException
29+
public Object findInjectableValue(DeserializationContext ctxt,
30+
Object valueId, BeanProperty forProperty, Object beanInstance,
31+
Boolean optional)
32+
throws JsonMappingException
3133
{
3234
// For backwards-compatibility, must delegate to old method
3335
return findInjectableValue(valueId, ctxt, forProperty, beanInstance);
@@ -80,7 +82,7 @@ public Std addValue(Class<?> classKey, Object value) {
8082
* @since 2.20
8183
*/
8284
@Override
83-
public Object findInjectableValue(Object valueId, DeserializationContext ctxt,
85+
public Object findInjectableValue(DeserializationContext ctxt, Object valueId,
8486
BeanProperty forProperty, Object beanInstance, Boolean optional)
8587
throws JsonMappingException
8688
{
@@ -113,7 +115,7 @@ public Object findInjectableValue(Object valueId, DeserializationContext ctxt,
113115
public Object findInjectableValue(Object valueId, DeserializationContext ctxt,
114116
BeanProperty forProperty, Object beanInstance) throws JsonMappingException
115117
{
116-
return this.findInjectableValue(valueId, ctxt, forProperty, beanInstance, null);
118+
return this.findInjectableValue(ctxt, valueId, forProperty, beanInstance, null);
117119
}
118120
}
119121
}

src/test/java/com/fasterxml/jackson/databind/introspect/IntrospectorPairTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ public JacksonInject.Value findInjectableValue(AnnotatedMember m) {
697697

698698
static class TestInjector extends InjectableValues {
699699
@Override
700-
public Object findInjectableValue(Object valueId, DeserializationContext ctxt,
700+
public Object findInjectableValue(DeserializationContext ctxt,
701+
Object valueId,
701702
BeanProperty forProperty, Object beanInstance, Boolean optional) {
702703
if (valueId == "jjj") {
703704
UnreadableBean bean = new UnreadableBean();

src/test/java/com/fasterxml/jackson/databind/tofix/JacksonInject4218Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ class MyInjectableValues extends InjectableValues.Std
3636

3737
@Override
3838
public Object findInjectableValue(
39-
Object valueId,
4039
DeserializationContext ctxt,
40+
Object valueId,
4141
BeanProperty forProperty,
4242
Object beanInstance,
4343
Boolean optional
4444
) throws JsonMappingException {
4545
if (valueId.equals("id")) {
4646
return "id" + nextId++;
4747
} else {
48-
return super.findInjectableValue(valueId, ctxt, forProperty, beanInstance, optional);
48+
return super.findInjectableValue(ctxt, valueId, forProperty, beanInstance, optional);
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)