Skip to content

Commit 9ac02b3

Browse files
committed
Remove pre-3.2 deprecated classes and methods
Issue: SPR-12578
1 parent fad7633 commit 9ac02b3

File tree

34 files changed

+77
-1649
lines changed

34 files changed

+77
-1649
lines changed

spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,6 @@ public static boolean isCglibProxy(Object object) {
8484
return (object instanceof SpringProxy && ClassUtils.isCglibProxy(object));
8585
}
8686

87-
/**
88-
* Check whether the specified class is a CGLIB-generated class.
89-
* @param clazz the class to check
90-
* @deprecated as of Spring 3.1 in favor of {@link ClassUtils#isCglibProxyClass(Class)}
91-
*/
92-
@Deprecated
93-
public static boolean isCglibProxyClass(Class<?> clazz) {
94-
return ClassUtils.isCglibProxyClass(clazz);
95-
}
96-
97-
/**
98-
* Check whether the specified class name is a CGLIB-generated class.
99-
* @param className the class name to check
100-
* @deprecated as of Spring 3.1 in favor of {@link ClassUtils#isCglibProxyClassName(String)}
101-
*/
102-
@Deprecated
103-
public static boolean isCglibProxyClassName(String className) {
104-
return ClassUtils.isCglibProxyClassName(className);
105-
}
106-
10787
/**
10888
* Determine the target class of the given bean instance which might be an AOP proxy.
10989
* <p>Returns the target class for an AOP proxy and the plain class else.

spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -166,16 +166,6 @@ public BeanDefinitionBuilder setFactoryMethod(String factoryMethod) {
166166
return this;
167167
}
168168

169-
/**
170-
* Add an indexed constructor arg value. The current index is tracked internally
171-
* and all additions are at the present point.
172-
* @deprecated since Spring 2.5, in favor of {@link #addConstructorArgValue}
173-
*/
174-
@Deprecated
175-
public BeanDefinitionBuilder addConstructorArg(Object value) {
176-
return addConstructorArgValue(value);
177-
}
178-
179169
/**
180170
* Add an indexed constructor arg value. The current index is tracked internally
181171
* and all additions are at the present point.

spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractSimpleBeanDefinitionParser.java

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -148,27 +148,9 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit
148148
* @see #isEligibleAttribute(String)
149149
*/
150150
protected boolean isEligibleAttribute(Attr attribute, ParserContext parserContext) {
151-
boolean eligible = isEligibleAttribute(attribute);
152-
if (!eligible) {
153-
String fullName = attribute.getName();
154-
eligible = (!fullName.equals("xmlns") && !fullName.startsWith("xmlns:") &&
155-
isEligibleAttribute(parserContext.getDelegate().getLocalName(attribute)));
156-
}
157-
return eligible;
158-
}
159-
160-
/**
161-
* Determine whether the given attribute is eligible for being
162-
* turned into a corresponding bean property value.
163-
* <p>The default implementation considers any attribute as eligible,
164-
* except for the "id" attribute and namespace declaration attributes.
165-
* @param attribute the XML attribute to check
166-
* @see #isEligibleAttribute(String)
167-
* @deprecated in favour of {@link #isEligibleAttribute(org.w3c.dom.Attr, ParserContext)}
168-
*/
169-
@Deprecated
170-
protected boolean isEligibleAttribute(Attr attribute) {
171-
return false;
151+
String fullName = attribute.getName();
152+
return (!fullName.equals("xmlns") && !fullName.startsWith("xmlns:") &&
153+
isEligibleAttribute(parserContext.getDelegate().getLocalName(attribute)));
172154
}
173155

174156
/**

spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionDocumentReader.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@
3737
*/
3838
public interface BeanDefinitionDocumentReader {
3939

40-
/**
41-
* Set the Environment to use when reading bean definitions.
42-
* <p>Used for evaluating profile information to determine whether a
43-
* {@code <beans/>} document/element should be included or ignored.
44-
* @deprecated in favor of {@link XmlReaderContext#getEnvironment()}
45-
*/
46-
@Deprecated
47-
void setEnvironment(Environment environment);
48-
4940
/**
5041
* Read bean definitions from the given DOM document and
5142
* register them with the registry in the given reader context.

spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ public class BeanDefinitionParserDelegate {
8888

8989
public static final String MULTI_VALUE_ATTRIBUTE_DELIMITERS = ",; ";
9090

91-
/** @deprecated as of Spring 3.1 in favor of {@link #MULTI_VALUE_ATTRIBUTE_DELIMITERS} */
92-
@Deprecated
93-
public static final String BEAN_NAME_DELIMITERS = MULTI_VALUE_ATTRIBUTE_DELIMITERS;
94-
9591
/**
9692
* Value of a T/F attribute that represents true.
9793
* Anything else represents false. Case seNsItive.
@@ -266,17 +262,6 @@ public BeanDefinitionParserDelegate(XmlReaderContext readerContext) {
266262
this.readerContext = readerContext;
267263
}
268264

269-
/**
270-
* Create a new BeanDefinitionParserDelegate associated with the supplied
271-
* {@link XmlReaderContext}.
272-
* @deprecated since the given {@link Environment} parameter is effectively
273-
* ignored in favor of {@link XmlReaderContext#getEnvironment()}
274-
*/
275-
@Deprecated
276-
public BeanDefinitionParserDelegate(XmlReaderContext readerContext, Environment environment) {
277-
this(readerContext);
278-
}
279-
280265

281266
/**
282267
* Get the {@link XmlReaderContext} associated with this helper instance.

spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultBeanDefinitionDocumentReader.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ public class DefaultBeanDefinitionDocumentReader implements BeanDefinitionDocume
8181
private BeanDefinitionParserDelegate delegate;
8282

8383

84-
@Deprecated
85-
@Override
86-
public void setEnvironment(Environment environment) {
87-
}
88-
8984
/**
9085
* This implementation parses bean definitions according to the "spring-beans" XSD
9186
* (or DTD, historically).

spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,8 @@ protected int detectValidationMode(Resource resource) {
502502
* @see #setDocumentReaderClass
503503
* @see BeanDefinitionDocumentReader#registerBeanDefinitions
504504
*/
505-
@SuppressWarnings("deprecation")
506505
public int registerBeanDefinitions(Document doc, Resource resource) throws BeanDefinitionStoreException {
507506
BeanDefinitionDocumentReader documentReader = createBeanDefinitionDocumentReader();
508-
documentReader.setEnvironment(getEnvironment());
509507
int countBefore = getRegistry().getBeanDefinitionCount();
510508
documentReader.registerBeanDefinitions(doc, createReaderContext(resource));
511509
return getRegistry().getBeanDefinitionCount() - countBefore;

spring-beans/src/main/java/org/springframework/beans/support/ResourceEditorRegistrar.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -62,21 +62,6 @@ public class ResourceEditorRegistrar implements PropertyEditorRegistrar {
6262
private final ResourceLoader resourceLoader;
6363

6464

65-
/**
66-
* Create a new ResourceEditorRegistrar for the given {@link ResourceLoader}
67-
* using a {@link StandardEnvironment}.
68-
* @param resourceLoader the ResourceLoader (or ResourcePatternResolver)
69-
* to create editors for (usually an ApplicationContext)
70-
* @see org.springframework.core.io.support.ResourcePatternResolver
71-
* @see org.springframework.context.ApplicationContext
72-
* @deprecated as of Spring 3.1 in favor of
73-
* {@link #ResourceEditorRegistrar(ResourceLoader, PropertyResolver)}
74-
*/
75-
@Deprecated
76-
public ResourceEditorRegistrar(ResourceLoader resourceLoader) {
77-
this(resourceLoader, new StandardEnvironment());
78-
}
79-
8065
/**
8166
* Create a new ResourceEditorRegistrar for the given {@link ResourceLoader}
8267
* and {@link PropertyResolver}.

spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -157,19 +157,6 @@ else if (formatter instanceof AnnotationFormatterFactory<?>) {
157157
registrar.registerFormatters(this.conversionService);
158158
}
159159
}
160-
installFormatters(this.conversionService);
161-
}
162-
163-
/**
164-
* Subclasses may override this method to register formatters and/or converters.
165-
* Starting with Spring 3.1 however the recommended way of doing that is to
166-
* through FormatterRegistrars.
167-
* @see #setFormatters(Set)
168-
* @see #setFormatterRegistrars(Set)
169-
* @deprecated since Spring 3.1 in favor of {@link #setFormatterRegistrars(Set)}
170-
*/
171-
@Deprecated
172-
protected void installFormatters(FormatterRegistry registry) {
173160
}
174161

175162

spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -427,39 +427,6 @@ public TypeDescriptor getMapValueTypeDescriptor(Object mapValue) {
427427
return narrow(mapValue, getMapValueTypeDescriptor());
428428
}
429429

430-
/**
431-
* Returns the value of {@link TypeDescriptor#getType() getType()} for the
432-
* {@link #getElementTypeDescriptor() elementTypeDescriptor}.
433-
* @deprecated in Spring 3.1 in favor of {@link #getElementTypeDescriptor()}
434-
* @throws IllegalStateException if this type is not a {@code java.util.Collection} or array type
435-
*/
436-
@Deprecated
437-
public Class<?> getElementType() {
438-
return getType(getElementTypeDescriptor());
439-
}
440-
441-
/**
442-
* Returns the value of {@link TypeDescriptor#getType() getType()} for the
443-
* {@link #getMapKeyTypeDescriptor() getMapKeyTypeDescriptor}.
444-
* @deprecated in Spring 3.1 in favor of {@link #getMapKeyTypeDescriptor()}
445-
* @throws IllegalStateException if this type is not a {@code java.util.Map}
446-
*/
447-
@Deprecated
448-
public Class<?> getMapKeyType() {
449-
return getType(getMapKeyTypeDescriptor());
450-
}
451-
452-
/**
453-
* Returns the value of {@link TypeDescriptor#getType() getType()} for the
454-
* {@link #getMapValueTypeDescriptor() getMapValueTypeDescriptor}.
455-
* @deprecated in Spring 3.1 in favor of {@link #getMapValueTypeDescriptor()}
456-
* @throws IllegalStateException if this type is not a {@code java.util.Map}
457-
*/
458-
@Deprecated
459-
public Class<?> getMapValueType() {
460-
return getType(getMapValueTypeDescriptor());
461-
}
462-
463430
private Class<?> getType(TypeDescriptor typeDescriptor) {
464431
return (typeDescriptor != null ? typeDescriptor.getType() : null);
465432
}

spring-core/src/main/java/org/springframework/core/convert/support/ConversionServiceFactory.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -60,22 +60,4 @@ else if (converter instanceof ConverterFactory<?, ?>) {
6060
}
6161
}
6262

63-
/**
64-
* Create a new default GenericConversionService instance that can be safely modified.
65-
* @deprecated in Spring 3.1 in favor of {@link DefaultConversionService#DefaultConversionService()}
66-
*/
67-
@Deprecated
68-
public static GenericConversionService createDefaultConversionService() {
69-
return new DefaultConversionService();
70-
}
71-
72-
/**
73-
* Populate the given GenericConversionService instance with the set of default converters.
74-
* @deprecated in Spring 3.1 in favor of {@link DefaultConversionService#addDefaultConverters(ConverterRegistry)}
75-
*/
76-
@Deprecated
77-
public static void addDefaultConverters(GenericConversionService conversionService) {
78-
DefaultConversionService.addDefaultConverters(conversionService);
79-
}
80-
8163
}

spring-core/src/main/java/org/springframework/core/io/ResourceEditor.java

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,32 +63,6 @@ public ResourceEditor() {
6363
this(new DefaultResourceLoader(), null);
6464
}
6565

66-
/**
67-
* Create a new instance of the {@link ResourceEditor} class
68-
* using the given {@link ResourceLoader} and a {@link StandardEnvironment}.
69-
* @param resourceLoader the {@code ResourceLoader} to use
70-
* @deprecated as of Spring 3.1 in favor of
71-
* {@link #ResourceEditor(ResourceLoader, PropertyResolver)}
72-
*/
73-
@Deprecated
74-
public ResourceEditor(ResourceLoader resourceLoader) {
75-
this(resourceLoader, null, true);
76-
}
77-
78-
/**
79-
* Create a new instance of the {@link ResourceEditor} class
80-
* using the given {@link ResourceLoader}.
81-
* @param resourceLoader the {@code ResourceLoader} to use
82-
* @param ignoreUnresolvablePlaceholders whether to ignore unresolvable placeholders
83-
* if no corresponding property could be found
84-
* @deprecated as of Spring 3.1 in favor of
85-
* {@link #ResourceEditor(ResourceLoader, PropertyResolver, boolean)}
86-
*/
87-
@Deprecated
88-
public ResourceEditor(ResourceLoader resourceLoader, boolean ignoreUnresolvablePlaceholders) {
89-
this(resourceLoader, null, ignoreUnresolvablePlaceholders);
90-
}
91-
9266
/**
9367
* Create a new instance of the {@link ResourceEditor} class
9468
* using the given {@link ResourceLoader} and {@link PropertyResolver}.

spring-core/src/main/java/org/springframework/core/io/support/ResourceArrayPropertyEditor.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,30 +74,6 @@ public ResourceArrayPropertyEditor() {
7474
this(new PathMatchingResourcePatternResolver(), null, true);
7575
}
7676

77-
/**
78-
* Create a new ResourceArrayPropertyEditor with the given {@link ResourcePatternResolver}
79-
* and a {@link StandardEnvironment}.
80-
* @param resourcePatternResolver the ResourcePatternResolver to use
81-
* @deprecated as of 3.1 in favor of {@link #ResourceArrayPropertyEditor(ResourcePatternResolver, PropertyResolver)}
82-
*/
83-
@Deprecated
84-
public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver) {
85-
this(resourcePatternResolver, null, true);
86-
}
87-
88-
/**
89-
* Create a new ResourceArrayPropertyEditor with the given {@link ResourcePatternResolver}
90-
* and a {@link StandardEnvironment}.
91-
* @param resourcePatternResolver the ResourcePatternResolver to use
92-
* @param ignoreUnresolvablePlaceholders whether to ignore unresolvable placeholders
93-
* if no corresponding system property could be found
94-
* @deprecated as of 3.1 in favor of {@link #ResourceArrayPropertyEditor(ResourcePatternResolver, PropertyResolver, boolean)}
95-
*/
96-
@Deprecated
97-
public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver, boolean ignoreUnresolvablePlaceholders) {
98-
this(resourcePatternResolver, null, ignoreUnresolvablePlaceholders);
99-
}
100-
10177
/**
10278
* Create a new ResourceArrayPropertyEditor with the given {@link ResourcePatternResolver}
10379
* and {@link PropertyResolver} (typically an {@link Environment}).

spring-expression/src/main/java/org/springframework/expression/common/ExpressionUtils.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,23 +32,6 @@
3232
*/
3333
public abstract class ExpressionUtils {
3434

35-
/**
36-
* Determines if there is a type converter available in the specified context and
37-
* attempts to use it to convert the supplied value to the specified type. Throws an
38-
* exception if conversion is not possible.
39-
* @param context the evaluation context that may define a type converter
40-
* @param value the value to convert (may be null)
41-
* @param targetType the type to attempt conversion to
42-
* @return the converted value
43-
* @throws EvaluationException if there is a problem during conversion or conversion
44-
* of the value to the specified type is not supported
45-
* @deprecated use {@link #convertTypedValue(EvaluationContext, TypedValue, Class)}
46-
*/
47-
@Deprecated
48-
public static <T> T convert(EvaluationContext context, Object value, Class<T> targetType) throws EvaluationException {
49-
return convertTypedValue(context, new TypedValue(value), targetType);
50-
}
51-
5235
/**
5336
* Determines if there is a type converter available in the specified context and
5437
* attempts to use it to convert the supplied value to the specified type. Throws an

0 commit comments

Comments
 (0)