Skip to content

Commit bc47440

Browse files
committed
Removed unused GrpcAdviceDiscoverer#isAnnotationPresent
1 parent a926211 commit bc47440

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public class GrpcAdviceDiscoverer implements InitializingBean, ApplicationContex
5252

5353
private ApplicationContext applicationContext;
5454
private Map<String, Object> annotatedBeans;
55-
private Set<Class<?>> annotatedClasses;
5655
private Set<Method> annotatedMethods;
5756

5857
@Override
@@ -66,19 +65,12 @@ public void afterPropertiesSet() {
6665
annotatedBeans.forEach(
6766
(key, value) -> log.debug("Found gRPC advice: " + key + ", class: " + value.getClass().getName()));
6867

69-
annotatedClasses = extractClassType();
7068
annotatedMethods = findAnnotatedMethods();
7169
}
7270

73-
private Set<Class<?>> extractClassType() {
74-
return annotatedBeans.values()
75-
.stream()
76-
.map(Object::getClass)
77-
.collect(Collectors.toSet());
78-
}
79-
8071
private Set<Method> findAnnotatedMethods() {
81-
return this.annotatedClasses.stream()
72+
return this.annotatedBeans.values().stream()
73+
.map(Object::getClass)
8274
.map(this::findAnnotatedMethods)
8375
.flatMap(Collection::stream)
8476
.collect(Collectors.toSet());
@@ -88,10 +80,6 @@ private Set<Method> findAnnotatedMethods(final Class<?> clazz) {
8880
return MethodIntrospector.selectMethods(clazz, EXCEPTION_HANDLER_METHODS);
8981
}
9082

91-
boolean isAnnotationPresent() {
92-
return !annotatedClasses.isEmpty() && !annotatedMethods.isEmpty();
93-
}
94-
9583
public Map<String, Object> getAnnotatedBeans() {
9684
Assert.state(annotatedBeans != null, "@GrpcAdvice annotation scanning failed.");
9785
return annotatedBeans;

0 commit comments

Comments
 (0)