Skip to content

Commit 91bd65b

Browse files
committed
Javadocs + minor cleanup
1 parent 4e96f26 commit 91bd65b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/advice/GrpcExceptionHandlerMethodResolver.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package net.devh.boot.grpc.server.advice;
1919

20+
import static java.util.Objects.requireNonNull;
21+
2022
import java.lang.reflect.Method;
2123
import java.util.AbstractMap.SimpleImmutableEntry;
2224
import java.util.Arrays;
@@ -30,12 +32,11 @@
3032
import org.springframework.lang.NonNull;
3133
import org.springframework.util.Assert;
3234

33-
import lombok.extern.slf4j.Slf4j;
34-
3535
/**
3636
* Given an annotated {@link GrpcAdvice @GrpcAdvice} class and annotated methods with
3737
* {@link GrpcExceptionHandler @GrpcExceptionHandler}, {@link GrpcExceptionHandlerMethodResolver} resolves given
3838
* exception type and maps it to the corresponding method to be executed, when this exception is being raised.
39+
*
3940
* <p>
4041
* For an example how to make use of it, please have a look at {@link GrpcExceptionHandler @GrpcExceptionHandler}.
4142
* <p>
@@ -45,7 +46,6 @@
4546
* @see GrpcExceptionHandler
4647
* @see GrpcAdviceExceptionHandler
4748
*/
48-
@Slf4j
4949
public class GrpcExceptionHandlerMethodResolver implements InitializingBean {
5050

5151
private final Map<Class<? extends Throwable>, Method> mappedMethods = new HashMap<>(16);
@@ -54,8 +54,12 @@ public class GrpcExceptionHandlerMethodResolver implements InitializingBean {
5454

5555
private Class<? extends Throwable>[] annotatedExceptions;
5656

57+
/**
58+
* Creates a new GrpcExceptionHandlerMethodResolver.
59+
* @param grpcAdviceDiscoverer The advice discoverer to use.
60+
*/
5761
public GrpcExceptionHandlerMethodResolver(final GrpcAdviceDiscoverer grpcAdviceDiscoverer) {
58-
this.grpcAdviceDiscoverer = grpcAdviceDiscoverer;
62+
this.grpcAdviceDiscoverer = requireNonNull(grpcAdviceDiscoverer, "grpcAdviceDiscoverer");
5963
}
6064

6165
@Override

0 commit comments

Comments
 (0)