Skip to content

Commit

Permalink
Remove pre-3.2 deprecated classes and methods
Browse files Browse the repository at this point in the history
Issue: SPR-12578
  • Loading branch information
jhoeller committed Dec 30, 2014
1 parent fad7633 commit 9ac02b3
Show file tree
Hide file tree
Showing 34 changed files with 77 additions and 1,649 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,6 @@ public static boolean isCglibProxy(Object object) {
return (object instanceof SpringProxy && ClassUtils.isCglibProxy(object));
}

/**
* Check whether the specified class is a CGLIB-generated class.
* @param clazz the class to check
* @deprecated as of Spring 3.1 in favor of {@link ClassUtils#isCglibProxyClass(Class)}
*/
@Deprecated
public static boolean isCglibProxyClass(Class<?> clazz) {
return ClassUtils.isCglibProxyClass(clazz);
}

/**
* Check whether the specified class name is a CGLIB-generated class.
* @param className the class name to check
* @deprecated as of Spring 3.1 in favor of {@link ClassUtils#isCglibProxyClassName(String)}
*/
@Deprecated
public static boolean isCglibProxyClassName(String className) {
return ClassUtils.isCglibProxyClassName(className);
}

/**
* Determine the target class of the given bean instance which might be an AOP proxy.
* <p>Returns the target class for an AOP proxy and the plain class else.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -166,16 +166,6 @@ public BeanDefinitionBuilder setFactoryMethod(String factoryMethod) {
return this;
}

/**
* Add an indexed constructor arg value. The current index is tracked internally
* and all additions are at the present point.
* @deprecated since Spring 2.5, in favor of {@link #addConstructorArgValue}
*/
@Deprecated
public BeanDefinitionBuilder addConstructorArg(Object value) {
return addConstructorArgValue(value);
}

/**
* Add an indexed constructor arg value. The current index is tracked internally
* and all additions are at the present point.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -148,27 +148,9 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit
* @see #isEligibleAttribute(String)
*/
protected boolean isEligibleAttribute(Attr attribute, ParserContext parserContext) {
boolean eligible = isEligibleAttribute(attribute);
if (!eligible) {
String fullName = attribute.getName();
eligible = (!fullName.equals("xmlns") && !fullName.startsWith("xmlns:") &&
isEligibleAttribute(parserContext.getDelegate().getLocalName(attribute)));
}
return eligible;
}

/**
* Determine whether the given attribute is eligible for being
* turned into a corresponding bean property value.
* <p>The default implementation considers any attribute as eligible,
* except for the "id" attribute and namespace declaration attributes.
* @param attribute the XML attribute to check
* @see #isEligibleAttribute(String)
* @deprecated in favour of {@link #isEligibleAttribute(org.w3c.dom.Attr, ParserContext)}
*/
@Deprecated
protected boolean isEligibleAttribute(Attr attribute) {
return false;
String fullName = attribute.getName();
return (!fullName.equals("xmlns") && !fullName.startsWith("xmlns:") &&
isEligibleAttribute(parserContext.getDelegate().getLocalName(attribute)));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@
*/
public interface BeanDefinitionDocumentReader {

/**
* Set the Environment to use when reading bean definitions.
* <p>Used for evaluating profile information to determine whether a
* {@code <beans/>} document/element should be included or ignored.
* @deprecated in favor of {@link XmlReaderContext#getEnvironment()}
*/
@Deprecated
void setEnvironment(Environment environment);

/**
* Read bean definitions from the given DOM document and
* register them with the registry in the given reader context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ public class BeanDefinitionParserDelegate {

public static final String MULTI_VALUE_ATTRIBUTE_DELIMITERS = ",; ";

/** @deprecated as of Spring 3.1 in favor of {@link #MULTI_VALUE_ATTRIBUTE_DELIMITERS} */
@Deprecated
public static final String BEAN_NAME_DELIMITERS = MULTI_VALUE_ATTRIBUTE_DELIMITERS;

/**
* Value of a T/F attribute that represents true.
* Anything else represents false. Case seNsItive.
Expand Down Expand Up @@ -266,17 +262,6 @@ public BeanDefinitionParserDelegate(XmlReaderContext readerContext) {
this.readerContext = readerContext;
}

/**
* Create a new BeanDefinitionParserDelegate associated with the supplied
* {@link XmlReaderContext}.
* @deprecated since the given {@link Environment} parameter is effectively
* ignored in favor of {@link XmlReaderContext#getEnvironment()}
*/
@Deprecated
public BeanDefinitionParserDelegate(XmlReaderContext readerContext, Environment environment) {
this(readerContext);
}


/**
* Get the {@link XmlReaderContext} associated with this helper instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ public class DefaultBeanDefinitionDocumentReader implements BeanDefinitionDocume
private BeanDefinitionParserDelegate delegate;


@Deprecated
@Override
public void setEnvironment(Environment environment) {
}

/**
* This implementation parses bean definitions according to the "spring-beans" XSD
* (or DTD, historically).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,8 @@ protected int detectValidationMode(Resource resource) {
* @see #setDocumentReaderClass
* @see BeanDefinitionDocumentReader#registerBeanDefinitions
*/
@SuppressWarnings("deprecation")
public int registerBeanDefinitions(Document doc, Resource resource) throws BeanDefinitionStoreException {
BeanDefinitionDocumentReader documentReader = createBeanDefinitionDocumentReader();
documentReader.setEnvironment(getEnvironment());
int countBefore = getRegistry().getBeanDefinitionCount();
documentReader.registerBeanDefinitions(doc, createReaderContext(resource));
return getRegistry().getBeanDefinitionCount() - countBefore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,21 +62,6 @@ public class ResourceEditorRegistrar implements PropertyEditorRegistrar {
private final ResourceLoader resourceLoader;


/**
* Create a new ResourceEditorRegistrar for the given {@link ResourceLoader}
* using a {@link StandardEnvironment}.
* @param resourceLoader the ResourceLoader (or ResourcePatternResolver)
* to create editors for (usually an ApplicationContext)
* @see org.springframework.core.io.support.ResourcePatternResolver
* @see org.springframework.context.ApplicationContext
* @deprecated as of Spring 3.1 in favor of
* {@link #ResourceEditorRegistrar(ResourceLoader, PropertyResolver)}
*/
@Deprecated
public ResourceEditorRegistrar(ResourceLoader resourceLoader) {
this(resourceLoader, new StandardEnvironment());
}

/**
* Create a new ResourceEditorRegistrar for the given {@link ResourceLoader}
* and {@link PropertyResolver}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -157,19 +157,6 @@ else if (formatter instanceof AnnotationFormatterFactory<?>) {
registrar.registerFormatters(this.conversionService);
}
}
installFormatters(this.conversionService);
}

/**
* Subclasses may override this method to register formatters and/or converters.
* Starting with Spring 3.1 however the recommended way of doing that is to
* through FormatterRegistrars.
* @see #setFormatters(Set)
* @see #setFormatterRegistrars(Set)
* @deprecated since Spring 3.1 in favor of {@link #setFormatterRegistrars(Set)}
*/
@Deprecated
protected void installFormatters(FormatterRegistry registry) {
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,39 +427,6 @@ public TypeDescriptor getMapValueTypeDescriptor(Object mapValue) {
return narrow(mapValue, getMapValueTypeDescriptor());
}

/**
* Returns the value of {@link TypeDescriptor#getType() getType()} for the
* {@link #getElementTypeDescriptor() elementTypeDescriptor}.
* @deprecated in Spring 3.1 in favor of {@link #getElementTypeDescriptor()}
* @throws IllegalStateException if this type is not a {@code java.util.Collection} or array type
*/
@Deprecated
public Class<?> getElementType() {
return getType(getElementTypeDescriptor());
}

/**
* Returns the value of {@link TypeDescriptor#getType() getType()} for the
* {@link #getMapKeyTypeDescriptor() getMapKeyTypeDescriptor}.
* @deprecated in Spring 3.1 in favor of {@link #getMapKeyTypeDescriptor()}
* @throws IllegalStateException if this type is not a {@code java.util.Map}
*/
@Deprecated
public Class<?> getMapKeyType() {
return getType(getMapKeyTypeDescriptor());
}

/**
* Returns the value of {@link TypeDescriptor#getType() getType()} for the
* {@link #getMapValueTypeDescriptor() getMapValueTypeDescriptor}.
* @deprecated in Spring 3.1 in favor of {@link #getMapValueTypeDescriptor()}
* @throws IllegalStateException if this type is not a {@code java.util.Map}
*/
@Deprecated
public Class<?> getMapValueType() {
return getType(getMapValueTypeDescriptor());
}

private Class<?> getType(TypeDescriptor typeDescriptor) {
return (typeDescriptor != null ? typeDescriptor.getType() : null);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -60,22 +60,4 @@ else if (converter instanceof ConverterFactory<?, ?>) {
}
}

/**
* Create a new default GenericConversionService instance that can be safely modified.
* @deprecated in Spring 3.1 in favor of {@link DefaultConversionService#DefaultConversionService()}
*/
@Deprecated
public static GenericConversionService createDefaultConversionService() {
return new DefaultConversionService();
}

/**
* Populate the given GenericConversionService instance with the set of default converters.
* @deprecated in Spring 3.1 in favor of {@link DefaultConversionService#addDefaultConverters(ConverterRegistry)}
*/
@Deprecated
public static void addDefaultConverters(GenericConversionService conversionService) {
DefaultConversionService.addDefaultConverters(conversionService);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,32 +63,6 @@ public ResourceEditor() {
this(new DefaultResourceLoader(), null);
}

/**
* Create a new instance of the {@link ResourceEditor} class
* using the given {@link ResourceLoader} and a {@link StandardEnvironment}.
* @param resourceLoader the {@code ResourceLoader} to use
* @deprecated as of Spring 3.1 in favor of
* {@link #ResourceEditor(ResourceLoader, PropertyResolver)}
*/
@Deprecated
public ResourceEditor(ResourceLoader resourceLoader) {
this(resourceLoader, null, true);
}

/**
* Create a new instance of the {@link ResourceEditor} class
* using the given {@link ResourceLoader}.
* @param resourceLoader the {@code ResourceLoader} to use
* @param ignoreUnresolvablePlaceholders whether to ignore unresolvable placeholders
* if no corresponding property could be found
* @deprecated as of Spring 3.1 in favor of
* {@link #ResourceEditor(ResourceLoader, PropertyResolver, boolean)}
*/
@Deprecated
public ResourceEditor(ResourceLoader resourceLoader, boolean ignoreUnresolvablePlaceholders) {
this(resourceLoader, null, ignoreUnresolvablePlaceholders);
}

/**
* Create a new instance of the {@link ResourceEditor} class
* using the given {@link ResourceLoader} and {@link PropertyResolver}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -74,30 +74,6 @@ public ResourceArrayPropertyEditor() {
this(new PathMatchingResourcePatternResolver(), null, true);
}

/**
* Create a new ResourceArrayPropertyEditor with the given {@link ResourcePatternResolver}
* and a {@link StandardEnvironment}.
* @param resourcePatternResolver the ResourcePatternResolver to use
* @deprecated as of 3.1 in favor of {@link #ResourceArrayPropertyEditor(ResourcePatternResolver, PropertyResolver)}
*/
@Deprecated
public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver) {
this(resourcePatternResolver, null, true);
}

/**
* Create a new ResourceArrayPropertyEditor with the given {@link ResourcePatternResolver}
* and a {@link StandardEnvironment}.
* @param resourcePatternResolver the ResourcePatternResolver to use
* @param ignoreUnresolvablePlaceholders whether to ignore unresolvable placeholders
* if no corresponding system property could be found
* @deprecated as of 3.1 in favor of {@link #ResourceArrayPropertyEditor(ResourcePatternResolver, PropertyResolver, boolean)}
*/
@Deprecated
public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver, boolean ignoreUnresolvablePlaceholders) {
this(resourcePatternResolver, null, ignoreUnresolvablePlaceholders);
}

/**
* Create a new ResourceArrayPropertyEditor with the given {@link ResourcePatternResolver}
* and {@link PropertyResolver} (typically an {@link Environment}).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,23 +32,6 @@
*/
public abstract class ExpressionUtils {

/**
* Determines if there is a type converter available in the specified context and
* attempts to use it to convert the supplied value to the specified type. Throws an
* exception if conversion is not possible.
* @param context the evaluation context that may define a type converter
* @param value the value to convert (may be null)
* @param targetType the type to attempt conversion to
* @return the converted value
* @throws EvaluationException if there is a problem during conversion or conversion
* of the value to the specified type is not supported
* @deprecated use {@link #convertTypedValue(EvaluationContext, TypedValue, Class)}
*/
@Deprecated
public static <T> T convert(EvaluationContext context, Object value, Class<T> targetType) throws EvaluationException {
return convertTypedValue(context, new TypedValue(value), targetType);
}

/**
* Determines if there is a type converter available in the specified context and
* attempts to use it to convert the supplied value to the specified type. Throws an
Expand Down
Loading

0 comments on commit 9ac02b3

Please sign in to comment.