Skip to content

Commit 1fda8f8

Browse files
committed
Yet more post-merge clean up for #4515
1 parent db04993 commit 1fda8f8

File tree

2 files changed

+9
-28
lines changed

2 files changed

+9
-28
lines changed

src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java

+6-22
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,6 @@ private void _addExplicitPropertyCreator(DeserializationContext ctxt,
510510
CreatorCandidate candidate)
511511
throws JsonMappingException
512512
{
513-
//System.err.println("_addExplicitPropertyCreator(): "+candidate);
514513
final int paramCount = candidate.paramCount();
515514
SettableBeanProperty[] properties = new SettableBeanProperty[paramCount];
516515

@@ -525,9 +524,12 @@ private void _addExplicitPropertyCreator(DeserializationContext ctxt,
525524
if (unwrapper != null) {
526525
_reportUnwrappedCreatorProperty(ctxt, beanDesc, param);
527526
}
528-
name = candidate.findImplicitParamName(i);
529-
_validateNamedPropertyParameter(ctxt, beanDesc, candidate, i,
530-
name, injectId);
527+
// Must be injectable or have name; without either won't work
528+
if ((name == null) && (injectId == null)) {
529+
ctxt.reportBadTypeDefinition(beanDesc,
530+
"Argument #%d of Creator %s has no property name (and is not Injectable): can not use as property-based Creator",
531+
i, candidate);
532+
}
531533
}
532534
properties[i] = constructCreatorProperty(ctxt, beanDesc, name, i, param, injectId);
533535
}
@@ -587,24 +589,6 @@ private boolean _handleSingleArgumentCreator(CreatorCollector creators,
587589
return false;
588590
}
589591

590-
// Helper method to check that parameter of Property-based creator either
591-
// has name or is marked as Injectable
592-
//
593-
// @since 2.12.1
594-
private void _validateNamedPropertyParameter(DeserializationContext ctxt,
595-
BeanDescription beanDesc,
596-
CreatorCandidate candidate, int paramIndex,
597-
PropertyName name, JacksonInject.Value injectId)
598-
throws JsonMappingException
599-
{
600-
// Must be injectable or have name; without either won't work
601-
if ((name == null) && (injectId == null)) {
602-
ctxt.reportBadTypeDefinition(beanDesc,
603-
"Argument #%d of Creator %s has no property name (and is not Injectable): can not use as property-based Creator",
604-
paramIndex, candidate);
605-
}
606-
}
607-
608592
// 01-Dec-2016, tatu: As per [databind#265] we cannot yet support passing
609593
// of unwrapped values through creator properties, so fail fast
610594
private void _reportUnwrappedCreatorProperty(DeserializationContext ctxt,

src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCandidate.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public PropertyName explicitParamName(int i) {
5959
return null;
6060
}
6161

62+
@Deprecated // since 2.18 (remove from 2.19 or later)
6263
public PropertyName findImplicitParamName(int i) {
6364
String str = _intr.findImplicitPropertyName(_params[i].annotated);
6465
if (str != null && !str.isEmpty()) {
@@ -67,12 +68,8 @@ public PropertyName findImplicitParamName(int i) {
6768
return null;
6869
}
6970

70-
/**
71-
* Specialized accessor that finds index of the one and only parameter
72-
* with NO injection and returns that; or, if none or more than one found,
73-
* returns -1.
74-
*/
75-
public int findOnlyParamWithoutInjection()
71+
@Deprecated // since 2.18 (remove from 2.19 or later)
72+
public int findOnlyParamWithoutInjectionX()
7673
{
7774
int missing = -1;
7875
for (int i = 0; i < _paramCount; ++i) {

0 commit comments

Comments
 (0)