Skip to content

Commit 9f34c30

Browse files
authored
Merge pull request #515 from yidongnan/fix/advice-condition
Prevent eager initialization of beans using getBeanNamesForAnnotation
2 parents fd5c77e + 70083a3 commit 9f34c30

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)