DATACMNS-1106 - Removed deprecations in ProjectionFactory.

Removed the deprecated implementation of ResourceLoaderAware in favor of BeanClassLoaderAware. Removed deprecated ProjectionFactory.getInputProperties() in favor of ….getProjectionInformation(). Removed the Java conditional to add a MethodInterceptor for default methods. Adapted test cases.
This commit is contained in:
Oliver Gierke
2017-07-11 09:30:41 +02:00
parent 023a0b2a38
commit 8026e9ff72
6 changed files with 14 additions and 78 deletions

View File

@@ -23,11 +23,9 @@ import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.io.ResourceLoader;
import org.springframework.data.projection.SpelAwareProxyProjectionFactory;
import org.springframework.util.ClassUtils;
import org.springframework.web.bind.WebDataBinder;
@@ -43,7 +41,7 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
* @since 1.10
*/
public class ProxyingHandlerMethodArgumentResolver extends ModelAttributeMethodProcessor
implements BeanFactoryAware, ResourceLoaderAware, BeanClassLoaderAware {
implements BeanFactoryAware, BeanClassLoaderAware {
private static final List<String> IGNORED_PACKAGES = Arrays.asList("java", "org.springframework");
@@ -72,16 +70,6 @@ public class ProxyingHandlerMethodArgumentResolver extends ModelAttributeMethodP
this.proxyFactory.setBeanFactory(beanFactory);
}
/**
* @see org.springframework.context.ResourceLoaderAware#setResourceLoader(org.springframework.core.io.ResourceLoader)
* @deprecated rather set the {@link ClassLoader} via {@link #setBeanClassLoader(ClassLoader)}.
*/
@Override
@Deprecated
public void setResourceLoader(ResourceLoader resourceLoader) {
this.proxyFactory.setResourceLoader(resourceLoader);
}
/*
* (non-Javadoc)
* @see org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader(java.lang.ClassLoader)
@@ -115,13 +103,9 @@ public class ProxyingHandlerMethodArgumentResolver extends ModelAttributeMethodP
}
// Fallback for only user defined interfaces
for (String prefix : IGNORED_PACKAGES) {
if (ClassUtils.getPackageName(type).startsWith(prefix)) {
return false;
}
}
String packageName = ClassUtils.getPackageName(type);
return true;
return !IGNORED_PACKAGES.stream().anyMatch(it -> packageName.startsWith(it));
}
/*