Skip to content

Commit

Permalink
Remove more deprecated introspection methods (#4525)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder authored May 14, 2024
1 parent ce0b5f9 commit 0813455
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 140 deletions.
27 changes: 0 additions & 27 deletions src/main/java/com/fasterxml/jackson/databind/BeanDescription.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,33 +256,6 @@ public AnnotatedMember findJsonKeyAccessor() {

public abstract AnnotatedMethod findMethod(String name, Class<?>[] paramTypes);

@Deprecated // since 2.9
public abstract AnnotatedMethod findJsonValueMethod();

/**
* @deprecated Since 2.9: use {@link #findAnySetterAccessor} instead
*/
@Deprecated
public AnnotatedMethod findAnySetter() {
AnnotatedMember m = findAnySetterAccessor();
if (m instanceof AnnotatedMethod) {
return (AnnotatedMethod) m;
}
return null;
}

/**
* @deprecated Since 2.9: use {@link #findAnySetterAccessor} instead
*/
@Deprecated
public AnnotatedMember findAnySetterField() {
AnnotatedMember m = findAnySetterAccessor();
if (m instanceof AnnotatedField) {
return m;
}
return null;
}

/*
/**********************************************************
/* Basic API, class configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,16 +887,6 @@ protected void _addExplicitPropertyCreator(DeserializationContext ctxt,
creators.addPropertyCreator(candidate.creator(), true, properties);
}

@Deprecated // since 2.12, remove from 2.13 or later
protected void _addExplicitAnyCreator(DeserializationContext ctxt,
BeanDescription beanDesc, CreatorCollector creators,
CreatorCandidate candidate)
throws JsonMappingException
{
_addExplicitAnyCreator(ctxt, beanDesc, creators, candidate,
ctxt.getConfig().getConstructorDetector());
}

/**
* Helper method called when there is explicit "is-creator" marker,
* but no mode declaration.
Expand Down Expand Up @@ -2484,52 +2474,10 @@ protected boolean _hasCreatorAnnotation(DeserializationContext ctxt,

/*
/**********************************************************
/* Deprecated helper methods
/* Helper classes
/**********************************************************
*/

/**
* Method called to see if given method has annotations that indicate
* a more specific type than what the argument specifies.
*
* @deprecated Since 2.8; call {@link #resolveMemberAndTypeAnnotations} instead
*/
@Deprecated
protected JavaType modifyTypeByAnnotation(DeserializationContext ctxt,
Annotated a, JavaType type)
throws JsonMappingException
{
AnnotationIntrospector intr = ctxt.getAnnotationIntrospector();
if (intr == null) {
return type;
}
return intr.refineDeserializationType(ctxt.getConfig(), a, type);
}

/**
* @deprecated since 2.8 call {@link #resolveMemberAndTypeAnnotations} instead.
*/
@Deprecated // since 2.8
protected JavaType resolveType(DeserializationContext ctxt,
BeanDescription beanDesc, JavaType type, AnnotatedMember member)
throws JsonMappingException
{
return resolveMemberAndTypeAnnotations(ctxt, member, type);
}

/**
* @deprecated since 2.8 call <code>findJsonValueMethod</code> on {@link BeanDescription} instead
*/
@Deprecated // not used, possibly remove as early as 2.9
protected AnnotatedMethod _findJsonValueFor(DeserializationConfig config, JavaType enumType)
{
if (enumType == null) {
return null;
}
BeanDescription beanDesc = config.introspect(enumType);
return beanDesc.findJsonValueMethod();
}

/**
* Helper class to contain default mappings for abstract JDK {@link java.util.Collection}
* and {@link java.util.Map} types. Separated out here to defer cost of creating lookups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,6 @@ public AnnotatedMember findJsonKeyAccessor() {
: _propCollector.getJsonKeyAccessor();
}

@Override
@Deprecated // since 2.9
public AnnotatedMethod findJsonValueMethod() {
return (_propCollector == null) ? null
: _propCollector.getJsonValueMethod();
}

@Override // since 2.9
public AnnotatedMember findJsonValueAccessor() {
return (_propCollector == null) ? null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,6 @@ public class POJOPropertiesCollector
*/
protected JsonFormat.Value _formatOverrides;

// // // Deprecated entries to remove from 3.0

/**
* @deprecated Since 2.12
*/
@Deprecated
protected final boolean _stdBeanNaming;

/**
* @deprecated Since 2.12
*/
@Deprecated
protected String _mutatorPrefix = "set";

/*
/**********************************************************
/* Life-cycle
Expand Down Expand Up @@ -194,31 +180,6 @@ protected POJOPropertiesCollector(MapperConfig<?> config, boolean forSerializati
_visibilityChecker = _config.getDefaultVisibilityChecker(type.getRawClass(),
classDef);
_accessorNaming = accessorNaming;

// for backwards-compatibility only
_stdBeanNaming = config.isEnabled(MapperFeature.USE_STD_BEAN_NAMING);
}

/**
* @deprecated Since 2.12
*/
@Deprecated
protected POJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization,
JavaType type, AnnotatedClass classDef,
String mutatorPrefix)
{
this(config, forSerialization, type, classDef,
_accessorNaming(config, classDef, mutatorPrefix));
_mutatorPrefix = mutatorPrefix;
}

private static AccessorNamingStrategy _accessorNaming(MapperConfig<?> config, AnnotatedClass classDef,
String mutatorPrefix) {
if (mutatorPrefix == null) {
mutatorPrefix = "set";
}
return new DefaultAccessorNamingStrategy.Provider()
.withSetterPrefix(mutatorPrefix).forPOJO(config, classDef);
}

/*
Expand Down Expand Up @@ -415,15 +376,6 @@ protected Map<String, POJOPropertyBuilder> getPropertyMap() {
return _properties;
}

@Deprecated // since 2.9
public AnnotatedMethod getJsonValueMethod() {
AnnotatedMember m = getJsonValueAccessor();
if (m instanceof AnnotatedMethod) {
return (AnnotatedMethod) m;
}
return null;
}

@Deprecated // since 2.11 (not used by anything at this point)
public Class<?> findPOJOBuilderClass() {
return _annotationIntrospector.findPOJOBuilder(_classDef);
Expand Down Expand Up @@ -1497,11 +1449,6 @@ private PropertyNamingStrategy _findNamingStrategy()
_config.canOverrideAccessModifiers());
}

@Deprecated // since 2.12.1 (temporarily missing from 2.12.0)
protected void _updateCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties) {
_replaceCreatorProperty(prop, creatorProperties);
}

protected boolean _replaceCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties) {
if (creatorProperties != null) {
final String intName = prop.getInternalName();
Expand Down

0 comments on commit 0813455

Please sign in to comment.