Skip to content

Commit 70083a3

Browse files
committed
Prevent eager initialization of beans using getBeanNamesForAnnotation
Fixes #513
1 parent fd5c77e commit 70083a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public ConfigurationPhase getConfigurationPhase() {
4242
public boolean matches(final ConditionContext context, final AnnotatedTypeMetadata metadata) {
4343
final ConfigurableListableBeanFactory safeBeanFactory =
4444
requireNonNull(context.getBeanFactory(), "ConfigurableListableBeanFactory is null");
45-
return !safeBeanFactory.getBeansWithAnnotation(GrpcAdvice.class).isEmpty();
45+
return safeBeanFactory.getBeanNamesForAnnotation(GrpcAdvice.class).length != 0;
4646
}
4747

4848
}

0 commit comments

Comments
 (0)