Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ public class GenericResponseService implements ApplicationContextAware {
private final Lock reentrantLock = new ReentrantLock();

/**
* The Context.
* The constant LOGGER.
*/
private ApplicationContext applicationContext;
private static final Logger LOGGER = LoggerFactory.getLogger(GenericResponseService.class);

/**
* The constant LOGGER.
* A list of all beans annotated with {@code @ControllerAdvice}
*/
private static final Logger LOGGER = LoggerFactory.getLogger(GenericResponseService.class);
private List<ControllerAdviceBean> controllerAdviceBeans;

/**
* Instantiates a new Generic response builder.
Expand Down Expand Up @@ -702,8 +702,6 @@ private Map<String, ApiResponse> getGenericMapResponse(HandlerMethod handlerMeth
.map(ControllerAdviceInfo::getApiResponseMap)
.collect(LinkedHashMap::new, Map::putAll, Map::putAll);

List<ControllerAdviceBean> controllerAdviceBeans = ControllerAdviceBean.findAnnotatedBeans(applicationContext);

List<ControllerAdviceInfo> controllerAdviceInfosNotInThisBean = controllerAdviceInfos.stream()
.filter(controllerAdviceInfo ->
getControllerAdviceBean(controllerAdviceBeans, controllerAdviceInfo.getControllerAdvice())
Expand Down Expand Up @@ -834,6 +832,6 @@ private boolean isGlobalException(Class<?> exceptionClass) {

@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
controllerAdviceBeans = ControllerAdviceBean.findAnnotatedBeans(applicationContext);
}
}