Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: spring-projects/spring-framework
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.3.10.RELEASE
Choose a base ref
...
head repository: spring-projects/spring-framework
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.3.11.RELEASE
Choose a head ref

Commits on Jul 20, 2017

  1. Copy the full SHA
    0e8bd71 View commit details
  2. Deprecate setContentDispositionFormData method

    The method was orginally added under SPR-14547 but the example in it
    was probably intended for use with Content-Disposition server response
    header (file download) and not for a Content-Disposition header
    within the body of a multipart request.
    
    In a Spring application a multipart request is typically serialized
    by the FormHttpMessageConverter and hence the Content-Disposition is
    not explicitly set by the application.
    rstoyanchev committed Jul 20, 2017
    Copy the full SHA
    cd602e5 View commit details

Commits on Jul 25, 2017

  1. Improve check for "Broken pipe" error message

    Issue: SPR-15802
    rstoyanchev committed Jul 25, 2017
    Copy the full SHA
    5f07434 View commit details

Commits on Aug 1, 2017

  1. Fix regression in HttpPutFormContentFilter

    Re-arrange the checks so that if there is no form parameter, then
    immediately and unconditionally delegate to super.getParameterValues().
    Or reversely if there is no super.getParameterValues() then return the
    form parameter.
    
    So the only remaining case is when combining values present in both.
    In that case we'll take both only if a queryString exists.
    
    One extra fix is to not even wrap the request if we did not parse any
    form parameters at all which can happen with HttpHiddenMethodFilter.
    
    Issue: SPR-15828, 15835
    rstoyanchev committed Aug 1, 2017
    Copy the full SHA
    3524849 View commit details

Commits on Aug 15, 2017

  1. Use exact type name in doc sample

    Issue: SPR-15863
    rstoyanchev committed Aug 15, 2017
    Copy the full SHA
    8b64ad3 View commit details

Commits on Aug 16, 2017

  1. Cancel WebAsyncManager thread on request timeout

    Issue: SPR-15852
    rstoyanchev committed Aug 16, 2017
    Copy the full SHA
    681ced8 View commit details

Commits on Sep 1, 2017

  1. Fix StringIndexOutOfBoundsException in RestTemplate

    Backport for commits #81dfad and #3d61f7
    
    Issue: SPR-15900
    Brian Bohl authored and rstoyanchev committed Sep 1, 2017
    Copy the full SHA
    f5d689e View commit details

Commits on Sep 8, 2017

  1. Consistent logging in Environment and PropertySource implementations

    Issue: SPR-15825
    (cherry picked from commit fac83b2)
    jhoeller committed Sep 8, 2017
    Copy the full SHA
    57fbdc0 View commit details
  2. checkConfigurationClassCandidate explicitly skips factory method defi…

    …nitions
    
    Issue: SPR-14603
    (cherry picked from commit 1fbd047)
    jhoeller committed Sep 8, 2017
    Copy the full SHA
    0088922 View commit details
  3. Leniently handle lambda-defined listeners with ErrorHandler as well

    Issue: SPR-15838
    (cherry picked from commit dd2bbcb)
    jhoeller committed Sep 8, 2017
    Copy the full SHA
    f948742 View commit details
  4. @lazy falls back to empty map/list/set for non-required collection de…

    …pendency
    
    Issue: SPR-15858
    (cherry picked from commit ec1eafc)
    jhoeller committed Sep 8, 2017
    Copy the full SHA
    80bf394 View commit details
  5. SimpleAsyncTaskExecutor properly respects NO_CONCURRENCY

    Issue: SPR-15895
    (cherry picked from commit 204ddeb)
    jhoeller committed Sep 8, 2017
    Copy the full SHA
    f3a2f57 View commit details
  6. Heart-beat log message potentially without session id

    Issue: SPR-15937
    (cherry picked from commit aa4ae7a)
    jhoeller committed Sep 8, 2017
    Copy the full SHA
    07a0a31 View commit details
  7. Copy the full SHA
    9dcdfec View commit details
  8. Downgrade to AspectJ 1.8.9 and merge EhCache 3 tests into spring-cont…

    …ext-support
    
    Includes latest applicable updates (Jackson 2.8.10, OkHttp 3.8.1, Undertow 1.3.31, Netty 4.1.15)
    
    Issue: SPR-15836
    Issue: SPR-15880
    jhoeller committed Sep 8, 2017
    Copy the full SHA
    fa2c377 View commit details
  9. Polishing

    jhoeller committed Sep 8, 2017
    Copy the full SHA
    17f42fc View commit details

Commits on Sep 10, 2017

  1. Copy the full SHA
    d1f42ac View commit details
  2. Copy the full SHA
    0d0399a View commit details
  3. Ignore Hibernate Validator style ".<collection element>" suffix for f…

    …ield path
    
    Issue: SPR-15916
    jhoeller committed Sep 10, 2017
    Copy the full SHA
    f944815 View commit details
  4. Javadoc syntax fixes

    jhoeller committed Sep 10, 2017
    Copy the full SHA
    c0ee1ff View commit details

Commits on Sep 11, 2017

  1. Copy the full SHA
    dcd2a03 View commit details
Showing with 482 additions and 236 deletions.
  1. +7 −7 build.gradle
  2. +1 −1 gradle.properties
  3. +2 −1 spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinition.java
  4. +1 −1 spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
  5. +1 −1 ...ontext-support}/src/test/java/org/springframework/cache/jcache/JCacheEhCache3AnnotationTests.java
  6. +1 −1 ...pring-context-support}/src/test/java/org/springframework/cache/jcache/JCacheEhCache3ApiTests.java
  7. +5 −5 ...-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheAnnotationTests.java
  8. +2 −3 spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheApiTests.java
  9. +2 −2 spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassUtils.java
  10. +16 −1 .../main/java/org/springframework/context/annotation/ContextAnnotationAutowireCandidateResolver.java
  11. +1 −1 spring-context/src/main/java/org/springframework/context/annotation/Profile.java
  12. +21 −17 ...ng-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java
  13. +2 −2 ...ontext/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java
  14. +14 −5 ...text/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java
  15. +4 −2 ...g-context/src/main/java/org/springframework/validation/beanvalidation/SpringValidatorAdapter.java
  16. +29 −7 ...xt/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorTests.java
  17. +38 −3 ...st/java/org/springframework/context/annotation/LazyAutowiredAnnotationBeanPostProcessorTests.java
  18. +25 −0 spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java
  19. +25 −2 ...ng-context/src/test/java/org/springframework/validation/beanvalidation/MethodValidationTests.java
  20. +11 −15 spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java
  21. +3 −3 spring-core/src/main/java/org/springframework/core/env/AbstractPropertyResolver.java
  22. +1 −1 spring-core/src/main/java/org/springframework/core/env/CompositePropertySource.java
  23. +13 −12 spring-core/src/main/java/org/springframework/core/env/MissingRequiredPropertiesException.java
  24. +13 −23 spring-core/src/main/java/org/springframework/core/env/MutablePropertySources.java
  25. +4 −9 spring-core/src/main/java/org/springframework/core/env/PropertySource.java
  26. +6 −5 spring-core/src/main/java/org/springframework/core/env/PropertySourcesPropertyResolver.java
  27. +2 −2 spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java
  28. +5 −2 spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java
  29. +2 −2 spring-core/src/main/java/org/springframework/util/ConcurrencyThrottleSupport.java
  30. +0 −32 spring-core/src/test/java/org/springframework/core/env/PropertySourceTests.java
  31. +4 −7 spring-core/src/test/java/org/springframework/core/task/SimpleAsyncTaskExecutorTests.java
  32. +5 −3 ...java/org/springframework/messaging/handler/invocation/AbstractExceptionHandlerMethodResolver.java
  33. +3 −2 spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
  34. +2 −2 ...framework/messaging/handler/annotation/support/AnnotationExceptionHandlerMethodResolverTests.java
  35. +26 −2 ...nate4/src/test/java/org/springframework/validation/hibernatevalidator5/MethodValidationTests.java
  36. +22 −7 spring-web/src/main/java/org/springframework/http/HttpHeaders.java
  37. +12 −9 spring-web/src/main/java/org/springframework/web/bind/WebDataBinder.java
  38. +1 −1 spring-web/src/main/java/org/springframework/web/client/RestTemplate.java
  39. +22 −0 spring-web/src/main/java/org/springframework/web/context/request/async/CallableInterceptorChain.java
  40. +15 −4 ...eb/src/main/java/org/springframework/web/context/request/async/CallableProcessingInterceptor.java
  41. +3 −1 spring-web/src/main/java/org/springframework/web/context/request/async/WebAsyncManager.java
  42. +13 −11 spring-web/src/main/java/org/springframework/web/filter/HttpPutFormContentFilter.java
  43. +4 −2 ...g-web/src/main/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolver.java
  44. +1 −0 spring-web/src/test/java/org/springframework/http/HttpHeadersTests.java
  45. +36 −5 spring-web/src/test/java/org/springframework/web/client/RestTemplateTests.java
  46. +31 −3 ...-web/src/test/java/org/springframework/web/context/request/async/WebAsyncManagerTimeoutTests.java
  47. +10 −1 spring-web/src/test/java/org/springframework/web/filter/HttpPutFormContentFilterTests.java
  48. +6 −2 .../src/test/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolverTests.java
  49. +4 −3 spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java
  50. +4 −2 .../src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java
  51. +1 −1 src/asciidoc/web-websocket.adoc
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ configure(allprojects) { project ->
group = "org.springframework"
version = qualifyVersionIfNecessary(version)

ext.aspectjVersion = "1.8.10"
ext.aspectjVersion = "1.8.9"
ext.caffeineVersion = "2.3.5"
ext.eclipselinkVersion = "2.4.2"
ext.ehcacheVersion = "2.10.4"
@@ -52,7 +52,7 @@ configure(allprojects) { project ->
ext.hsqldbVersion = "2.3.4"
ext.httpasyncVersion = "4.1.3"
ext.httpclientVersion = "4.5.3"
ext.jackson2Version = "2.8.9"
ext.jackson2Version = "2.8.10"
ext.jasperreportsVersion = "6.2.1" // our tests fail with JR-internal NPEs against 6.2.2 and higher
ext.javamailVersion = "1.5.6"
ext.jettyVersion = "9.3.14.v20161028" // as of 9.3.15, Jetty has hard Servlet 3.1 requirement
@@ -62,9 +62,9 @@ configure(allprojects) { project ->
ext.jtaVersion = "1.2"
ext.junitVersion = "4.12"
ext.log4jVersion = "1.2.17"
ext.nettyVersion = "4.1.13.Final"
ext.nettyVersion = "4.1.15.Final"
ext.okhttpVersion = "2.7.5"
ext.okhttp3Version = "3.7.0"
ext.okhttp3Version = "3.8.1"
ext.openjpaVersion = "2.4.1"
ext.poiVersion = "3.14"
ext.reactorVersion = "2.0.8.RELEASE"
@@ -77,7 +77,7 @@ configure(allprojects) { project ->
ext.tiles3Version = "3.0.7"
ext.tomcatVersion = "8.5.16"
ext.tyrusVersion = "1.3.5" // constrained by WebLogic 12.1.3 support
ext.undertowVersion = "1.3.30.Final"
ext.undertowVersion = "1.3.31.Final"
ext.xmlunitVersion = "1.6"
ext.xstreamVersion = "1.4.9"

@@ -658,6 +658,8 @@ project("spring-context-support") {
testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
testRuntime("org.ehcache:ehcache:${ehcache3Version}")
testRuntime("org.terracotta:management-model:2.3.0")
}
}

@@ -1034,8 +1036,6 @@ project("spring-test") {
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
testCompile("javax.cache:cache-api:1.0.0")
testRuntime("log4j:log4j:${log4jVersion}")
testRuntime("org.ehcache:ehcache:${ehcache3Version}")
testRuntime("org.terracotta:management-model:2.3.0")
}

task testNG(type: Test) {
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=4.3.10.BUILD-SNAPSHOT
version=4.3.11.RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2017 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.
@@ -232,6 +232,7 @@ public interface BeanDefinition extends AttributeAccessor, BeanMetadataElement {
/**
* Return whether this a <b>Prototype</b>, with an independent instance
* returned for each call.
* @since 3.0
* @see #SCOPE_PROTOTYPE
*/
boolean isPrototype();
Original file line number Diff line number Diff line change
@@ -366,7 +366,7 @@ public Object getObject() throws BeansException {
}

// Check if required type matches the type of the actual bean instance.
if (requiredType != null && bean != null && !requiredType.isAssignableFrom(bean.getClass())) {
if (requiredType != null && bean != null && !requiredType.isInstance(bean)) {
try {
return getTypeConverter().convertIfNecessary(bean, requiredType);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@@ -16,7 +16,6 @@

package org.springframework.cache.jcache;

import javax.annotation.Resource;
import javax.cache.CacheManager;
import javax.cache.Caching;
import javax.cache.configuration.MutableConfiguration;
@@ -26,6 +25,7 @@
import org.junit.Ignore;
import org.junit.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.config.AbstractCacheAnnotationTests;
@@ -59,7 +59,7 @@ protected ConfigurableApplicationContext getApplicationContext() {
}

protected CachingProvider getCachingProvider() {
return Caching.getCachingProvider();
return Caching.getCachingProvider("org.ehcache.jcache.JCacheCachingProvider");
}

@After
@@ -81,7 +81,7 @@ public void testCustomCacheManager() {
@EnableCaching
static class EnableCachingConfig extends CachingConfigurerSupport {

@Resource
@Autowired
CachingProvider cachingProvider;

@Override
@@ -93,7 +93,7 @@ public org.springframework.cache.CacheManager cacheManager() {
@Bean
public CacheManager jCacheManager() {
CacheManager cacheManager = this.cachingProvider.getCacheManager();
MutableConfiguration<Object, Object> mutableConfiguration = new MutableConfiguration<Object, Object>();
MutableConfiguration<Object, Object> mutableConfiguration = new MutableConfiguration<>();
mutableConfiguration.setStoreByValue(false); // otherwise value has to be Serializable
cacheManager.createCache("testCache", mutableConfiguration);
cacheManager.createCache("primary", mutableConfiguration);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@@ -48,7 +48,7 @@ public void setup() {
}

protected CachingProvider getCachingProvider() {
return Caching.getCachingProvider();
return Caching.getCachingProvider("org.ehcache.jcache.JCacheCachingProvider");
}

@After
@@ -58,7 +58,6 @@ public void shutdown() {
}
}


@Override
protected JCacheCache getCache() {
return this.cache;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@@ -79,7 +79,7 @@ abstract class ConfigurationClassUtils {
*/
public static boolean checkConfigurationClassCandidate(BeanDefinition beanDef, MetadataReaderFactory metadataReaderFactory) {
String className = beanDef.getBeanClassName();
if (className == null) {
if (className == null || beanDef.getFactoryMethodName() != null) {
return false;
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -18,6 +18,11 @@

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.aop.TargetSource;
import org.springframework.aop.framework.ProxyFactory;
@@ -82,6 +87,16 @@ public boolean isStatic() {
public Object getTarget() {
Object target = beanFactory.doResolveDependency(descriptor, beanName, null, null);
if (target == null) {
Class<?> type = getTargetClass();
if (Map.class == type) {
return Collections.EMPTY_MAP;
}
else if (List.class == type) {
return Collections.EMPTY_LIST;
}
else if (Set.class == type || Collection.class == type) {
return Collections.EMPTY_SET;
}
throw new NoSuchBeanDefinitionException(descriptor.getResolvableType(),
"Optional dependency not present for lazy injection point");
}
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@
* {@code @Profile} can therefore not be used to select an overloaded method with a
* particular argument signature over another; resolution between all factory methods
* for the same bean follows Spring's constructor resolution algorithm at creation time.
* <b>Use distinct Java method names pointing to the same {@link @Bean#name bean name}
* <b>Use distinct Java method names pointing to the same {@link Bean#name bean name}
* if you'd like to define alternative beans with different profile conditions</b>;
* see {@code ProfileDatabaseConfig} in {@link Configuration @Configuration}'s javadoc.
*
Original file line number Diff line number Diff line change
@@ -151,34 +151,38 @@ private ResolvableType resolveDefaultEventType(ApplicationEvent event) {
* @param event the current event to propagate
* @since 4.1
*/
@SuppressWarnings({"unchecked", "rawtypes"})
protected void invokeListener(ApplicationListener listener, ApplicationEvent event) {
protected void invokeListener(ApplicationListener<?> listener, ApplicationEvent event) {
ErrorHandler errorHandler = getErrorHandler();
if (errorHandler != null) {
try {
listener.onApplicationEvent(event);
doInvokeListener(listener, event);
}
catch (Throwable err) {
errorHandler.handleError(err);
}
}
else {
try {
listener.onApplicationEvent(event);
}
catch (ClassCastException ex) {
String msg = ex.getMessage();
if (msg == null || msg.startsWith(event.getClass().getName())) {
// Possibly a lambda-defined listener which we could not resolve the generic event type for
Log logger = LogFactory.getLog(getClass());
if (logger.isDebugEnabled()) {
logger.debug("Non-matching event type for listener: " + listener, ex);
}
}
else {
throw ex;
doInvokeListener(listener, event);
}
}

@SuppressWarnings({"unchecked", "rawtypes"})
private void doInvokeListener(ApplicationListener listener, ApplicationEvent event) {
try {
listener.onApplicationEvent(event);
}
catch (ClassCastException ex) {
String msg = ex.getMessage();
if (msg == null || msg.startsWith(event.getClass().getName())) {
// Possibly a lambda-defined listener which we could not resolve the generic event type for
Log logger = LogFactory.getLog(getClass());
if (logger.isDebugEnabled()) {
logger.debug("Non-matching event type for listener: " + listener, ex);
}
}
else {
throw ex;
}
}
}

Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@
* instead. If you really need programmatic {@code #forExecutables} access, inject this class as
* a {@link ValidatorFactory} and call {@link #getValidator()} on it, then {@code #forExecutables}
* on the returned native {@link Validator} reference instead of directly on this class.
* Alternatively, call {@code #unwrap(Validator.class) which will also provide the native object.
* Alternatively, call {@code #unwrap(Validator.class)} which will also provide the native object.
*
* <p>This class is also being used by Spring's MVC configuration namespace, in case of the
* {@code javax.validation} API being present but no explicit Validator having been configured.
@@ -353,7 +353,7 @@ else if (args[0] instanceof Method) {
ReflectionUtils.invokeMethod(parameterNameProviderMethod, configuration, parameterNameProvider);

}
catch (Exception ex) {
catch (Throwable ex) {
// Bean Validation 1.1 API not available - simply not applying the ParameterNameDiscoverer
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@@ -81,7 +81,7 @@ public class MethodValidationInterceptor implements MethodInterceptor {
}


private final Validator validator;
private volatile Validator validator;


/**
@@ -116,7 +116,18 @@ public Object invoke(MethodInvocation invocation) throws Throwable {

if (forExecutablesMethod != null) {
// Standard Bean Validation 1.1 API
Object execVal = ReflectionUtils.invokeMethod(forExecutablesMethod, this.validator);
Object execVal;
try {
execVal = ReflectionUtils.invokeMethod(forExecutablesMethod, this.validator);
}
catch (AbstractMethodError err) {
// Probably an adapter (maybe a lazy-init proxy) without BV 1.1 support
Validator nativeValidator = this.validator.unwrap(Validator.class);
execVal = ReflectionUtils.invokeMethod(forExecutablesMethod, nativeValidator);
// If successful, store native Validator for further use
this.validator = nativeValidator;
}

Method methodToValidate = invocation.getMethod();
Set<ConstraintViolation<?>> result;

@@ -137,13 +148,11 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
}

Object returnValue = invocation.proceed();

result = (Set<ConstraintViolation<?>>) ReflectionUtils.invokeMethod(validateReturnValueMethod,
execVal, invocation.getThis(), methodToValidate, returnValue, groups);
if (!result.isEmpty()) {
throw new ConstraintViolationException(result);
}

return returnValue;
}

Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@
* <p>Note that Bean Validation 1.1's {@code #forExecutables} method isn't supported
* on this adapter: We do not expect that method to be called by application code;
* consider {@link MethodValidationInterceptor} instead. If you really need programmatic
* {@code #forExecutables} access, call {@code #unwrap(Validator.class) which will
* {@code #forExecutables} access, call {@code #unwrap(Validator.class)} which will
* provide the native {@link Validator} object with {@code #forExecutables} support.
*
* @author Juergen Hoeller
@@ -177,7 +177,9 @@ protected void processConstraintViolations(Set<ConstraintViolation<Object>> viol
* @see org.springframework.validation.FieldError#getField()
*/
protected String determineField(ConstraintViolation<Object> violation) {
return violation.getPropertyPath().toString();
String path = violation.getPropertyPath().toString();
int elementIndex = path.indexOf(".<");
return (elementIndex >= 0 ? path.substring(0, elementIndex) : path);
}

/**
Loading