@@ -104,9 +104,8 @@ protected void initHandlerMethods() {
104
104
getApplicationContext ().getBeanNamesForType (Object .class ));
105
105
106
106
for (String beanName : beanNames ) {
107
- Class <?> candidateType = getApplicationContext ().getType (beanName );
108
- if (isHandler (candidateType )){
109
- detectHandlerMethods (beanName , candidateType );
107
+ if (isHandler (getApplicationContext ().getType (beanName ))){
108
+ detectHandlerMethods (beanName );
110
109
}
111
110
}
112
111
handlerMethodsInitialized (getHandlerMethods ());
@@ -121,20 +120,12 @@ protected void initHandlerMethods() {
121
120
122
121
/**
123
122
* Look for handler methods in a handler.
124
- * <p>Delegates to {@link #detectHandlerMethods(Object, Class)} for actual processing.
125
123
* @param handler the bean name of a handler or a handler instance
126
124
*/
127
125
protected void detectHandlerMethods (final Object handler ) {
128
126
Class <?> handlerType =
129
127
(handler instanceof String ? getApplicationContext ().getType ((String ) handler ) : handler .getClass ());
130
- detectHandlerMethods (handler , handlerType );
131
- }
132
128
133
- /**
134
- * Look for handler methods in a handler, against a pre-resolved type.
135
- * @param handler the bean name of a handler or a handler instance
136
- */
137
- protected void detectHandlerMethods (Object handler , Class <?> handlerType ) {
138
129
final Class <?> userType = ClassUtils .getUserClass (handlerType );
139
130
Set <Method > methods = HandlerMethodSelector .selectMethods (userType , new MethodFilter () {
140
131
@ Override
@@ -342,17 +333,16 @@ protected HandlerMethod handleNoMatch(Set<T> mappings, String lookupPath, HttpSe
342
333
343
334
344
335
/**
345
- * A thin wrapper around a matched HandlerMethod and its matched mapping for
346
- * the purpose of comparing the best match with a comparator in the context
347
- * of the current request.
336
+ * A thin wrapper around a matched HandlerMethod and its mapping, for the purpose of
337
+ * comparing the best match with a comparator in the context of the current request.
348
338
*/
349
339
private class Match {
350
340
351
341
private final T mapping ;
352
342
353
343
private final HandlerMethod handlerMethod ;
354
344
355
- private Match (T mapping , HandlerMethod handlerMethod ) {
345
+ public Match (T mapping , HandlerMethod handlerMethod ) {
356
346
this .mapping = mapping ;
357
347
this .handlerMethod = handlerMethod ;
358
348
}
0 commit comments