pull/1779/head
shedfreewu 2 months ago
parent f166c2034a
commit c4d6cf3b43

@ -93,12 +93,12 @@ public class ApplicationContextAwareUtils implements ApplicationContextAware {
return getBeanIfExists(requiredType, false);
}
public static <T> T getBeanIfExists(Class<T> requiredType, boolean warnIfNotFailed) {
public static <T> T getBeanIfExists(Class<T> requiredType, boolean warnIfFailed) {
try {
return applicationContext.getBean(requiredType);
}
catch (Throwable e) {
if (warnIfNotFailed) {
if (warnIfFailed) {
LOGGER.warn("get bean failed, bean type: {}", requiredType.getName());
}
return null;

Loading…
Cancel
Save