Skip to content

Commit

Permalink
Remove no longer supported protected methods
Browse files Browse the repository at this point in the history
Closes gh-26721
  • Loading branch information
rstoyanchev committed Jun 27, 2023
1 parent d4ac90d commit 91eb2be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.springframework.web.method.annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.util.Map;
import java.util.Optional;

Expand Down Expand Up @@ -188,33 +187,16 @@ private static Object wrapAsOptionalIfNecessary(MethodParameter parameter, @Null
* @param attributeName the name of the attribute (never {@code null})
* @param parameter the method parameter declaration
* @param binderFactory for creating WebDataBinder instance
* @param webRequest the current request
* @return the created model attribute (never {@code null})
* @throws BindException in case of constructor argument binding failure
* @throws Exception in case of constructor instantiation failure
* @see #constructAttribute(Constructor, String, MethodParameter, WebDataBinderFactory, NativeWebRequest)
* @see BeanUtils#findPrimaryConstructor(Class)
* @param request the current request
* @return the created model attribute, or {@code null}
*/
@Nullable
protected Object createAttribute(String attributeName, MethodParameter parameter,
WebDataBinderFactory binderFactory, NativeWebRequest webRequest) throws Exception {
WebDataBinderFactory binderFactory, NativeWebRequest request) throws Exception {

return null;
}

/**
* Construct a new attribute instance with the given constructor.
* @since 5.1
* @deprecated and not called; replaced by built-in support for
* constructor initialization in {@link org.springframework.validation.DataBinder}
*/
@Deprecated(since = "6.1", forRemoval = true)
protected Object constructAttribute(Constructor<?> ctor, String attributeName, MethodParameter parameter,
WebDataBinderFactory binderFactory, NativeWebRequest webRequest) throws Exception {

throw new UnsupportedOperationException();
}

/**
* Extension point to create the attribute, binding the request to constructor args.
* @param binder the data binder instance to use for the binding
Expand All @@ -234,18 +216,6 @@ protected void bindRequestParameters(WebDataBinder binder, NativeWebRequest requ
((WebRequestDataBinder) binder).bind(request);
}

/**
* Resolve the value for a constructor argument.
* @deprecated and not called; replaced by built-in support for
* constructor initialization in {@link org.springframework.validation.DataBinder}
*/
@Deprecated(since = "6.1", forRemoval = true)
public Object resolveConstructorArgument(String paramName, Class<?> paramType, NativeWebRequest request)
throws Exception {

throw new UnsupportedOperationException();
}

/**
* Validate the model attribute if applicable.
* <p>The default implementation checks for {@code @jakarta.validation.Valid},
Expand All @@ -266,19 +236,6 @@ protected void validateIfApplicable(WebDataBinder binder, MethodParameter parame
}
}

/**
* Validate the specified candidate value if applicable.
* @since 5.1
* @deprecated and not called; replaced by built-in support for
* constructor initialization in {@link org.springframework.validation.DataBinder}
*/
@Deprecated(since = "6.1", forRemoval = true)
protected void validateValueIfApplicable(WebDataBinder binder, MethodParameter parameter,
Class<?> targetType, String fieldName, @Nullable Object value) {

throw new UnsupportedOperationException();
}

/**
* Whether to raise a fatal bind exception on validation errors.
* <p>The default implementation delegates to {@link #isBindExceptionRequired(MethodParameter)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,6 @@ private Object removeReactiveAttribute(String name, Model model) {
return null;
}

/**
* Protected method to obtain the values for data binding.
* @deprecated and not called; replaced by built-in support for
* constructor initialization in {@link org.springframework.validation.DataBinder}
*/
@Deprecated(since = "6.1", forRemoval = true)
public Mono<Map<String, Object>> getValuesToBind(WebExchangeDataBinder binder, ServerWebExchange exchange) {
throw new UnsupportedOperationException();
}

/**
* Extension point to create the attribute, binding the request to constructor args.
* @param binder the data binder instance to use for the binding
Expand Down

0 comments on commit 91eb2be

Please sign in to comment.