INT-2689 - SI builds without warnings (Except Spring Integration HTTP)

* Ensure that no deprecation warnings occur
* Spring Integration builds with all tests successfully for Spring 3.1.2.RELEASE and 3.0.7.RELEASE (Except Spring Integration HTTP)

For reference see: https://jira.springsource.org/browse/INT-2689

INT-2694 - Fix Http Test Failures with Spring 3.0

As part of INT-2689, fix Http Test Failures in the Spring Integration Http Module when using Spring 3.0.7.RELEASE
For reference see: https://jira.springsource.org/browse/INT-2694
This commit is contained in:
Gunnar Hillert
2012-07-30 15:34:47 -04:00
committed by Oleg Zhurakousky
parent 19c53ed9e9
commit 57bc67b8fb
27 changed files with 283 additions and 168 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 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.
@@ -27,9 +27,10 @@ import org.springframework.util.ReflectionUtils.MethodCallback;
/**
* Helper to provide common features for inspecting objects and locating annotated methods.
*
*
* @author Dave Syer
*
* @author Gunnar Hillert
*
*/
abstract class AnnotationFinder {
@@ -45,6 +46,7 @@ abstract class AnnotationFinder {
return reference.get();
}
@SuppressWarnings("deprecation")
private static Class<?> getTargetClass(Object targetObject) {
Class<?> targetClass = targetObject.getClass();
if (AopUtils.isAopProxy(targetObject)) {

View File

@@ -32,7 +32,7 @@ import org.springframework.jmx.export.annotation.ManagedResource;
/**
* Base class for all Message Routers.
*
*
* @author Mark Fisher
* @author Oleg Zhurakousky
* @author Gunnar Hillert
@@ -50,12 +50,12 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
/**
* Set the default channel where Messages should be sent if channel resolution
* fails to return any channels. If no default channel is provided and channel
* resolution fails to return any channels, the router will throw an
* {@link MessageDeliveryException}.
*
* If messages shall be ignored (dropped) instead, please provide a {@link NullChannel}.
* Set the default channel where Messages should be sent if channel resolution
* fails to return any channels. If no default channel is provided and channel
* resolution fails to return any channels, the router will throw an
* {@link MessageDeliveryException}.
*
* If messages shall be ignored (dropped) instead, please provide a {@link NullChannel}.
*/
public void setDefaultOutputChannel(MessageChannel defaultOutputChannel) {
this.defaultOutputChannel = defaultOutputChannel;
@@ -100,6 +100,7 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
return this.messagingTemplate;
}
@SuppressWarnings("deprecation")
protected ConversionService getRequiredConversionService() {
if (this.getConversionService() == null) {
this.setConversionService(ConversionServiceFactory.createDefaultConversionService());

View File

@@ -29,12 +29,12 @@ import org.springframework.validation.DataBinder;
/**
* Will transform Map to an instance of Object. There are two ways to specify the type of the transformed Object.
* You can use one of two constructors. The constructor that takes the Class&lt;?&gt; as an argument will construct the Object of
* You can use one of two constructors. The constructor that takes the Class&lt;?&gt; as an argument will construct the Object of
* that type. There is another constructor that takes a 'beanName' as an argument and will populate this bean with transformed data.
* Such bean must be of 'prototype' scope otherwise {@link MessageTransformationException} will be thrown.
* This transformer is integrated with the {@link ConversionService} allowing values in the Map to be converted
* This transformer is integrated with the {@link ConversionService} allowing values in the Map to be converted
* to types that represent the properties of the Object.
*
*
* @author Oleg Zhurakousky
* @since 2.0
*/
@@ -63,11 +63,12 @@ public class MapToObjectTransformer extends AbstractPayloadTransformer<Map<?,?>,
* (non-Javadoc)
* @see org.springframework.integration.transformer.AbstractPayloadTransformer#transformPayload(java.lang.Object)
*/
@SuppressWarnings("deprecation")
protected Object transformPayload(Map<?,?> payload) throws Exception {
Object target = (this.targetClass != null)
? BeanUtils.instantiate(this.targetClass)
: this.getBeanFactory().getBean(this.targetBeanName);
DataBinder binder = new DataBinder(target);
DataBinder binder = new DataBinder(target);
ConversionService conversionService = null;
if (this.getBeanFactory() instanceof ConfigurableBeanFactory){
conversionService = ((ConfigurableBeanFactory)this.getBeanFactory()).getConversionService();
@@ -79,7 +80,7 @@ public class MapToObjectTransformer extends AbstractPayloadTransformer<Map<?,?>,
binder.bind(new MutablePropertyValues(payload));
return target;
}
protected void onInit(){
if (StringUtils.hasText(this.targetBeanName)) {
Assert.isTrue(this.getBeanFactory().isPrototype(this.targetBeanName),

View File

@@ -43,6 +43,7 @@ public class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware
private volatile ConversionService conversionService;
@SuppressWarnings("deprecation")
public BeanFactoryTypeConverter() {
synchronized (BeanFactoryTypeConverter.class) {
if (defaultConversionService == null) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 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.
@@ -68,10 +68,12 @@ import org.springframework.util.StringUtils;
* is provided, and more than one declared method has that name, the method-selection will be dynamic, based on the
* underlying SpEL method resolution. Alternatively, an annotation type may be provided so that the candidates for
* SpEL's method resolution are determined by the presence of that annotation rather than the method name.
*
*
* @author Mark Fisher
* @author Oleg Zhurakousky
* @author Dave Syer
* @author Gunnar Hillert
*
* @since 2.0
*/
public class MessagingMethodInvokerHelper<T> extends AbstractExpressionEvaluator {
@@ -280,7 +282,7 @@ public class MessagingMethodInvokerHelper<T> extends AbstractExpressionEvaluator
if (isMethodDefinedOnObjectClass(method)) {
return;
}
if (method.getDeclaringClass().equals(Proxy.class)) {
if (method.getDeclaringClass().equals(Proxy.class)) {
return;
}
if (!Modifier.isPublic(method.getModifiers())) {
@@ -354,6 +356,7 @@ public class MessagingMethodInvokerHelper<T> extends AbstractExpressionEvaluator
return fallbackMethods;
}
@SuppressWarnings("deprecation")
private Class<?> getTargetClass(Object targetObject) {
Class<?> targetClass = targetObject.getClass();
if (AopUtils.isAopProxy(targetObject)) {