diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractExceptionHandlerMethodResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractExceptionHandlerMethodResolver.java index e4e6b6632a2..6bf11cf119b 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractExceptionHandlerMethodResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractExceptionHandlerMethodResolver.java @@ -66,9 +66,9 @@ public abstract class AbstractExceptionHandlerMethodResolver { } /** - * Extract the exceptions this method handles.This implementation looks for + * Extract the exceptions this method handles. This implementation looks for * sub-classes of Throwable in the method signature. - * The method is static to ensure safe use from sub-class constructors. + *
The method is static to ensure safe use from sub-class constructors.
*/
@SuppressWarnings("unchecked")
protected static List Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exception the exception
* @return a Method to handle the exception, or {@code null} if none found
*/
@@ -113,6 +113,7 @@ public abstract class AbstractExceptionHandlerMethodResolver {
/**
* Find a {@link Method} to handle the given exception type. This can be
* useful if an {@link Exception} instance is not available (e.g. for tools).
+ * Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exceptionType the exception type
* @return a Method to handle the exception, or {@code null} if none found
* @since 4.3.1
@@ -128,7 +129,8 @@ public abstract class AbstractExceptionHandlerMethodResolver {
}
/**
- * Return the {@link Method} mapped to the given exception type, or {@code null} if none.
+ * Return the {@link Method} mapped to the given exception type, or
+ * {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} if none.
*/
@Nullable
private Method getMappedMethod(Class extends Throwable> exceptionType) {
@@ -150,8 +152,9 @@ public abstract class AbstractExceptionHandlerMethodResolver {
}
/**
- * For the NO_MATCHING_EXCEPTION_HANDLER_METHOD constant.
+ * For the {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} constant.
*/
+ @SuppressWarnings("unused")
private void noMatchingExceptionHandler() {
}
diff --git a/spring-web/src/main/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolver.java b/spring-web/src/main/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolver.java
index 3d5995ceae9..8850d58be45 100644
--- a/spring-web/src/main/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolver.java
+++ b/spring-web/src/main/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolver.java
@@ -125,7 +125,7 @@ public class ExceptionHandlerMethodResolver {
/**
* Find a {@link Method} to handle the given exception.
- * Use {@link ExceptionDepthComparator} if more than one match is found.
+ * Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exception the exception
* @return a Method to handle the exception, or {@code null} if none found
*/
@@ -136,7 +136,7 @@ public class ExceptionHandlerMethodResolver {
/**
* Find a {@link Method} to handle the given Throwable.
- * Use {@link ExceptionDepthComparator} if more than one match is found.
+ * Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exception the exception
* @return a Method to handle the exception, or {@code null} if none found
* @since 5.0
@@ -156,6 +156,7 @@ public class ExceptionHandlerMethodResolver {
/**
* Find a {@link Method} to handle the given exception type. This can be
* useful if an {@link Exception} instance is not available (e.g. for tools).
+ * Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exceptionType the exception type
* @return a Method to handle the exception, or {@code null} if none found
*/
@@ -170,7 +171,8 @@ public class ExceptionHandlerMethodResolver {
}
/**
- * Return the {@link Method} mapped to the given exception type, or {@code null} if none.
+ * Return the {@link Method} mapped to the given exception type, or
+ * {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} if none.
*/
private Method getMappedMethod(Class extends Throwable> exceptionType) {
List