Skip to content

Commit

Permalink
Move HandlerMethodValidator to web.method.annotation package
Browse files Browse the repository at this point in the history
Avoiding cycle between web.method.support and web.method.annotation packages.

See gh-29825
  • Loading branch information
jhoeller committed Jun 14, 2023
1 parent e344f3f commit 220995b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.springframework.web.method.support;
package org.springframework.web.method.annotation;

import java.lang.reflect.Method;

Expand All @@ -35,7 +35,6 @@
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.support.ConfigurableWebBindingInitializer;
import org.springframework.web.bind.support.WebBindingInitializer;
import org.springframework.web.method.annotation.ModelFactory;

/**
* {@link org.springframework.validation.beanvalidation.MethodValidator} for
Expand All @@ -48,7 +47,6 @@
*/
public final class HandlerMethodValidator extends DefaultMethodValidator {


private HandlerMethodValidator(MethodValidationAdapter adapter) {
super(adapter);
}
Expand Down Expand Up @@ -86,7 +84,7 @@ private String determineObjectName(MethodParameter param, @Nullable Object argum
return Conventions.getVariableNameForParameter(param);
}
else {
return ((param.getParameterIndex() != -1) ?
return (param.getParameterIndex() != -1 ?
ModelFactory.getNameForParameter(param) :
ModelFactory.getNameForReturnValue(argument, param));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.springframework.validation.beanvalidation.MethodValidator;
import org.springframework.web.bind.support.WebBindingInitializer;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.method.support.HandlerMethodValidator;
import org.springframework.web.method.annotation.HandlerMethodValidator;
import org.springframework.web.reactive.BindingContext;
import org.springframework.web.reactive.DispatchExceptionHandler;
import org.springframework.web.reactive.HandlerAdapter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.method.annotation.ErrorsMethodArgumentResolver;
import org.springframework.web.method.annotation.ExpressionValueMethodArgumentResolver;
import org.springframework.web.method.annotation.HandlerMethodValidator;
import org.springframework.web.method.annotation.InitBinderDataBinderFactory;
import org.springframework.web.method.annotation.MapMethodProcessor;
import org.springframework.web.method.annotation.ModelFactory;
Expand All @@ -88,7 +89,6 @@
import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
import org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite;
import org.springframework.web.method.support.HandlerMethodValidator;
import org.springframework.web.method.support.InvocableHandlerMethod;
import org.springframework.web.method.support.ModelAndViewContainer;
import org.springframework.web.servlet.ModelAndView;
Expand Down

0 comments on commit 220995b

Please sign in to comment.