Skip to content

Commit 91eb2be

Browse files
committed
Remove no longer supported protected methods
Closes gh-26721
1 parent d4ac90d commit 91eb2be

File tree

2 files changed

+3
-56
lines changed

2 files changed

+3
-56
lines changed

Diff for: spring-web/src/main/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessor.java

+3-46
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.web.method.annotation;
1818

1919
import java.lang.annotation.Annotation;
20-
import java.lang.reflect.Constructor;
2120
import java.util.Map;
2221
import java.util.Optional;
2322

@@ -188,33 +187,16 @@ private static Object wrapAsOptionalIfNecessary(MethodParameter parameter, @Null
188187
* @param attributeName the name of the attribute (never {@code null})
189188
* @param parameter the method parameter declaration
190189
* @param binderFactory for creating WebDataBinder instance
191-
* @param webRequest the current request
192-
* @return the created model attribute (never {@code null})
193-
* @throws BindException in case of constructor argument binding failure
194-
* @throws Exception in case of constructor instantiation failure
195-
* @see #constructAttribute(Constructor, String, MethodParameter, WebDataBinderFactory, NativeWebRequest)
196-
* @see BeanUtils#findPrimaryConstructor(Class)
190+
* @param request the current request
191+
* @return the created model attribute, or {@code null}
197192
*/
198193
@Nullable
199194
protected Object createAttribute(String attributeName, MethodParameter parameter,
200-
WebDataBinderFactory binderFactory, NativeWebRequest webRequest) throws Exception {
195+
WebDataBinderFactory binderFactory, NativeWebRequest request) throws Exception {
201196

202197
return null;
203198
}
204199

205-
/**
206-
* Construct a new attribute instance with the given constructor.
207-
* @since 5.1
208-
* @deprecated and not called; replaced by built-in support for
209-
* constructor initialization in {@link org.springframework.validation.DataBinder}
210-
*/
211-
@Deprecated(since = "6.1", forRemoval = true)
212-
protected Object constructAttribute(Constructor<?> ctor, String attributeName, MethodParameter parameter,
213-
WebDataBinderFactory binderFactory, NativeWebRequest webRequest) throws Exception {
214-
215-
throw new UnsupportedOperationException();
216-
}
217-
218200
/**
219201
* Extension point to create the attribute, binding the request to constructor args.
220202
* @param binder the data binder instance to use for the binding
@@ -234,18 +216,6 @@ protected void bindRequestParameters(WebDataBinder binder, NativeWebRequest requ
234216
((WebRequestDataBinder) binder).bind(request);
235217
}
236218

237-
/**
238-
* Resolve the value for a constructor argument.
239-
* @deprecated and not called; replaced by built-in support for
240-
* constructor initialization in {@link org.springframework.validation.DataBinder}
241-
*/
242-
@Deprecated(since = "6.1", forRemoval = true)
243-
public Object resolveConstructorArgument(String paramName, Class<?> paramType, NativeWebRequest request)
244-
throws Exception {
245-
246-
throw new UnsupportedOperationException();
247-
}
248-
249219
/**
250220
* Validate the model attribute if applicable.
251221
* <p>The default implementation checks for {@code @jakarta.validation.Valid},
@@ -266,19 +236,6 @@ protected void validateIfApplicable(WebDataBinder binder, MethodParameter parame
266236
}
267237
}
268238

269-
/**
270-
* Validate the specified candidate value if applicable.
271-
* @since 5.1
272-
* @deprecated and not called; replaced by built-in support for
273-
* constructor initialization in {@link org.springframework.validation.DataBinder}
274-
*/
275-
@Deprecated(since = "6.1", forRemoval = true)
276-
protected void validateValueIfApplicable(WebDataBinder binder, MethodParameter parameter,
277-
Class<?> targetType, String fieldName, @Nullable Object value) {
278-
279-
throw new UnsupportedOperationException();
280-
}
281-
282239
/**
283240
* Whether to raise a fatal bind exception on validation errors.
284241
* <p>The default implementation delegates to {@link #isBindExceptionRequired(MethodParameter)}.

Diff for: spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java

-10
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,6 @@ private Object removeReactiveAttribute(String name, Model model) {
181181
return null;
182182
}
183183

184-
/**
185-
* Protected method to obtain the values for data binding.
186-
* @deprecated and not called; replaced by built-in support for
187-
* constructor initialization in {@link org.springframework.validation.DataBinder}
188-
*/
189-
@Deprecated(since = "6.1", forRemoval = true)
190-
public Mono<Map<String, Object>> getValuesToBind(WebExchangeDataBinder binder, ServerWebExchange exchange) {
191-
throw new UnsupportedOperationException();
192-
}
193-
194184
/**
195185
* Extension point to create the attribute, binding the request to constructor args.
196186
* @param binder the data binder instance to use for the binding

0 commit comments

Comments
 (0)