Skip to content

Commit 55e17ef

Browse files
committed
Polishing contribution
Closes gh-27203
1 parent f2be4e9 commit 55e17ef

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

spring-web/src/main/java/org/springframework/web/method/HandlerMethod.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ public HandlerMethod(Object bean, Method method) {
105105
this(bean, method, null);
106106
}
107107

108-
109108
/**
110109
* Variant of {@link #HandlerMethod(Object, Method)} that
111-
* also accepts a {@link MessageSource}.
110+
* also accepts a {@link MessageSource} for use from sub-classes.
111+
* @since 5.3.10
112112
*/
113-
public HandlerMethod(Object bean, Method method, @Nullable MessageSource messageSource) {
113+
protected HandlerMethod(Object bean, Method method, @Nullable MessageSource messageSource) {
114114
Assert.notNull(bean, "Bean is required");
115115
Assert.notNull(method, "Method is required");
116116
this.bean = bean;

spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,9 +74,10 @@ public InvocableHandlerMethod(Object bean, Method method) {
7474

7575
/**
7676
* Variant of {@link #InvocableHandlerMethod(Object, Method)} that
77-
* also accepts a {@link MessageSource}.
77+
* also accepts a {@link MessageSource}, for use in sub-classes.
78+
* @since 5.3.10
7879
*/
79-
public InvocableHandlerMethod(Object bean, Method method, @Nullable MessageSource messageSource) {
80+
protected InvocableHandlerMethod(Object bean, Method method, @Nullable MessageSource messageSource) {
8081
super(bean, method, messageSource);
8182
}
8283

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletInvocableHandlerMethod.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -69,13 +69,6 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
6969
@Nullable
7070
private HandlerMethodReturnValueHandlerComposite returnValueHandlers;
7171

72-
/**
73-
* Variant of {@link #ServletInvocableHandlerMethod(Object, Method)} that
74-
* also accepts a {@link MessageSource}.
75-
*/
76-
public ServletInvocableHandlerMethod(Object handler, Method method, @Nullable MessageSource messageSource) {
77-
super(handler, method, messageSource);
78-
}
7972

8073
/**
8174
* Creates an instance from the given handler and method.
@@ -84,6 +77,16 @@ public ServletInvocableHandlerMethod(Object handler, Method method) {
8477
super(handler, method);
8578
}
8679

80+
/**
81+
* Variant of {@link #ServletInvocableHandlerMethod(Object, Method)} that
82+
* also accepts a {@link MessageSource}, e.g. to resolve
83+
* {@code @ResponseStatus} messages with.
84+
* @since 5.3.10
85+
*/
86+
public ServletInvocableHandlerMethod(Object handler, Method method, @Nullable MessageSource messageSource) {
87+
super(handler, method, messageSource);
88+
}
89+
8790
/**
8891
* Create an instance from a {@code HandlerMethod}.
8992
*/

0 commit comments

Comments
 (0)