Skip to content

Commit 2fd6e6e

Browse files
committed
Polish Javadoc for base ExceptionHandlerMethodResolvers
1 parent 570bdbd commit 2fd6e6e

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractExceptionHandlerMethodResolver.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ protected AbstractExceptionHandlerMethodResolver(Map<Class<? extends Throwable>,
6666
}
6767

6868
/**
69-
* Extract the exceptions this method handles.This implementation looks for
69+
* Extract the exceptions this method handles. This implementation looks for
7070
* sub-classes of Throwable in the method signature.
71-
* The method is static to ensure safe use from sub-class constructors.
71+
* <p>The method is static to ensure safe use from sub-class constructors.
7272
*/
7373
@SuppressWarnings("unchecked")
7474
protected static List<Class<? extends Throwable>> getExceptionsFromMethodSignature(Method method) {
@@ -94,7 +94,7 @@ public boolean hasExceptionMappings() {
9494

9595
/**
9696
* Find a {@link Method} to handle the given exception.
97-
* Use {@link ExceptionDepthComparator} if more than one match is found.
97+
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
9898
* @param exception the exception
9999
* @return a Method to handle the exception, or {@code null} if none found
100100
*/
@@ -113,6 +113,7 @@ public Method resolveMethod(Throwable exception) {
113113
/**
114114
* Find a {@link Method} to handle the given exception type. This can be
115115
* useful if an {@link Exception} instance is not available (e.g. for tools).
116+
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
116117
* @param exceptionType the exception type
117118
* @return a Method to handle the exception, or {@code null} if none found
118119
* @since 4.3.1
@@ -128,7 +129,8 @@ public Method resolveMethodByExceptionType(Class<? extends Throwable> exceptionT
128129
}
129130

130131
/**
131-
* Return the {@link Method} mapped to the given exception type, or {@code null} if none.
132+
* Return the {@link Method} mapped to the given exception type, or
133+
* {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} if none.
132134
*/
133135
@Nullable
134136
private Method getMappedMethod(Class<? extends Throwable> exceptionType) {
@@ -150,8 +152,9 @@ private Method getMappedMethod(Class<? extends Throwable> exceptionType) {
150152
}
151153

152154
/**
153-
* For the NO_MATCHING_EXCEPTION_HANDLER_METHOD constant.
155+
* For the {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} constant.
154156
*/
157+
@SuppressWarnings("unused")
155158
private void noMatchingExceptionHandler() {
156159
}
157160

spring-web/src/main/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolver.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public boolean hasExceptionMappings() {
125125

126126
/**
127127
* Find a {@link Method} to handle the given exception.
128-
* Use {@link ExceptionDepthComparator} if more than one match is found.
128+
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
129129
* @param exception the exception
130130
* @return a Method to handle the exception, or {@code null} if none found
131131
*/
@@ -136,7 +136,7 @@ public Method resolveMethod(Exception exception) {
136136

137137
/**
138138
* Find a {@link Method} to handle the given Throwable.
139-
* Use {@link ExceptionDepthComparator} if more than one match is found.
139+
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
140140
* @param exception the exception
141141
* @return a Method to handle the exception, or {@code null} if none found
142142
* @since 5.0
@@ -156,6 +156,7 @@ public Method resolveMethodByThrowable(Throwable exception) {
156156
/**
157157
* Find a {@link Method} to handle the given exception type. This can be
158158
* useful if an {@link Exception} instance is not available (e.g. for tools).
159+
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
159160
* @param exceptionType the exception type
160161
* @return a Method to handle the exception, or {@code null} if none found
161162
*/
@@ -170,7 +171,8 @@ public Method resolveMethodByExceptionType(Class<? extends Throwable> exceptionT
170171
}
171172

172173
/**
173-
* Return the {@link Method} mapped to the given exception type, or {@code null} if none.
174+
* Return the {@link Method} mapped to the given exception type, or
175+
* {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} if none.
174176
*/
175177
private Method getMappedMethod(Class<? extends Throwable> exceptionType) {
176178
List<Class<? extends Throwable>> matches = new ArrayList<>();
@@ -191,8 +193,9 @@ private Method getMappedMethod(Class<? extends Throwable> exceptionType) {
191193
}
192194

193195
/**
194-
* For the NO_MATCHING_EXCEPTION_HANDLER_METHOD constant.
196+
* For the {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} constant.
195197
*/
198+
@SuppressWarnings("unused")
196199
private void noMatchingExceptionHandler() {
197200
}
198201

0 commit comments

Comments
 (0)