@@ -165,8 +165,8 @@ public void setBeanName(String name) {
165
165
}
166
166
167
167
public String getBeanName () {
168
- return this .beanName != null ? this .beanName :
169
- getClass ().getSimpleName () + "@" + ObjectUtils .getIdentityHexString (this );
168
+ return ( this .beanName != null ? this .beanName :
169
+ getClass ().getSimpleName () + "@" + ObjectUtils .getIdentityHexString (this )) ;
170
170
}
171
171
172
172
/**
@@ -269,7 +269,7 @@ private void initHandlerMethods() {
269
269
* Detect if the given handler has any methods that can handle messages and if
270
270
* so register it with the extracted mapping information.
271
271
* <p><strong>Note:</strong> This method is protected and can be invoked by
272
- * sub-classes , but this should be done on startup only as documented in
272
+ * subclasses , but this should be done on startup only as documented in
273
273
* {@link #registerHandlerMethod}.
274
274
* @param handler the handler to check, either an instance of a Spring bean name
275
275
*/
@@ -321,7 +321,7 @@ private String formatMappings(Class<?> userType, Map<Method, T> methods) {
321
321
/**
322
322
* Register a handler method and its unique mapping.
323
323
* <p><strong>Note:</strong> This method is protected and can be invoked by
324
- * sub-classes . Keep in mind however that the registration is not protected
324
+ * subclasses . Keep in mind however that the registration is not protected
325
325
* for concurrent use, and is expected to be done on startup.
326
326
* @param handler the bean name of the handler or the handler instance
327
327
* @param method the method to register
@@ -369,7 +369,7 @@ private HandlerMethod createHandlerMethod(Object handler, Method method) {
369
369
* Return String-based destinations for the given mapping, if any, that can
370
370
* be used to find matches with a direct lookup (i.e. non-patterns).
371
371
* <p><strong>Note:</strong> This is completely optional. The mapping
372
- * metadata for a sub-class may support neither direct lookups, nor String
372
+ * metadata for a subclass may support neither direct lookups, nor String
373
373
* based destinations.
374
374
*/
375
375
protected abstract Set <String > getDirectLookupMappings (T mapping );
@@ -395,7 +395,7 @@ private Match<T> getHandlerMethod(Message<?> message) {
395
395
List <Match <T >> matches = new ArrayList <>();
396
396
397
397
RouteMatcher .Route destination = getDestination (message );
398
- List <T > mappingsByUrl = destination != null ? this .destinationLookup .get (destination .value ()) : null ;
398
+ List <T > mappingsByUrl = ( destination != null ? this .destinationLookup .get (destination .value ()) : null ) ;
399
399
if (mappingsByUrl != null ) {
400
400
addMatchesToCollection (mappingsByUrl , message , matches );
401
401
}
@@ -419,10 +419,9 @@ private Match<T> getHandlerMethod(Message<?> message) {
419
419
if (comparator .compare (bestMatch , secondBestMatch ) == 0 ) {
420
420
HandlerMethod m1 = bestMatch .handlerMethod ;
421
421
HandlerMethod m2 = secondBestMatch .handlerMethod ;
422
- throw new IllegalStateException (
423
- "Ambiguous handler methods mapped for destination '" +
424
- destination .value () + "': {" +
425
- m1 .getShortLogMessage () + ", " + m2 .getShortLogMessage () + "}" );
422
+ throw new IllegalStateException ("Ambiguous handler methods mapped for destination '" +
423
+ (destination != null ? destination .value () : "" ) + "': {" +
424
+ m1 .getShortLogMessage () + ", " + m2 .getShortLogMessage () + "}" );
426
425
}
427
426
}
428
427
return bestMatch ;
@@ -494,13 +493,11 @@ private static class Match<T> {
494
493
495
494
private final HandlerMethod handlerMethod ;
496
495
497
-
498
496
Match (T mapping , HandlerMethod handlerMethod ) {
499
497
this .mapping = mapping ;
500
498
this .handlerMethod = handlerMethod ;
501
499
}
502
500
503
-
504
501
public T getMapping () {
505
502
return this .mapping ;
506
503
}
@@ -509,7 +506,6 @@ public HandlerMethod getHandlerMethod() {
509
506
return this .handlerMethod ;
510
507
}
511
508
512
-
513
509
@ Override
514
510
public String toString () {
515
511
return this .mapping .toString ();
@@ -521,12 +517,10 @@ private class MatchComparator implements Comparator<Match<T>> {
521
517
522
518
private final Comparator <T > comparator ;
523
519
524
-
525
520
MatchComparator (Comparator <T > comparator ) {
526
521
this .comparator = comparator ;
527
522
}
528
523
529
-
530
524
@ Override
531
525
public int compare (Match <T > match1 , Match <T > match2 ) {
532
526
return this .comparator .compare (match1 .mapping , match2 .mapping );
0 commit comments