Deprecation warning from spring Deprecation warning from spring spring spring

Deprecation warning from spring


Adding custom editor fixed warning:

public final class EnumPropertyEditor extends PropertyEditorSupport {    public EnumPropertyEditor() {    }    @Override    public String getAsText() {       return (String) getValue();    }    @Override    public void setAsText(String text) throws IllegalArgumentException {       setValue(text);   }}

In config:

<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">    <property name="customEditors">        <map>            <entry key="java.lang.Enum">                <bean class="package.EnumPropertyEditor">                </bean>            </entry>        </map>    </property></bean>


It's telling you that it's using a deprecated fallback method to find a property editor for enums, instead of using a property editor registered with Spring, and that you should consider using a dedicated property editor for enums and registering it with Spring, using the mechanisms described in the documentation.

If you don't do so, your code could not work right in future versionsof Spring, because Spring could not use this fallback mechanism anymore.

That said, The 3.1.x version of still has this fallback mechanism.