diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java index 6494d931a2a0..9bb266a887a7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java @@ -121,26 +121,20 @@ public void setApplicationContext(ApplicationContext applicationContext) throws @Override public BeanFactoryInitializationAotContribution processAheadOfTime(ConfigurableListableBeanFactory beanFactory) { - return new BeanFactoryInitializationAotContribution() { - - @Override - public void applyTo(GenerationContext generationContext, - BeanFactoryInitializationCode beanFactoryInitializationCode) { - for (String beanName : beanFactory.getBeanDefinitionNames()) { - BeanDefinition definition = beanFactory.getBeanDefinition(beanName); - if (Objects.equals(definition.getBeanClassName(), - WebListenerHandler.ServletComponentWebListenerRegistrar.class.getName())) { - String listenerClassName = (String) definition.getConstructorArgumentValues() - .getArgumentValue(0, String.class) - .getValue(); - generationContext.getRuntimeHints() - .reflection() - .registerType(TypeReference.of(listenerClassName), - MemberCategory.INVOKE_DECLARED_CONSTRUCTORS); - } + return (generationContext, beanFactoryInitializationCode) -> { + for (String beanName : beanFactory.getBeanDefinitionNames()) { + BeanDefinition definition = beanFactory.getBeanDefinition(beanName); + if (Objects.equals(definition.getBeanClassName(), + WebListenerHandler.ServletComponentWebListenerRegistrar.class.getName())) { + String listenerClassName = (String) definition.getConstructorArgumentValues() + .getArgumentValue(0, String.class) + .getValue(); + generationContext.getRuntimeHints() + .reflection() + .registerType(TypeReference.of(listenerClassName), + MemberCategory.INVOKE_DECLARED_CONSTRUCTORS); } } - }; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java index d1a615718cc4..761cfbb17cde 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java @@ -321,12 +321,12 @@ private static class ErrorWrapperResponse extends HttpServletResponseWrapper { } @Override - public void sendError(int status) throws IOException { + public void sendError(int status) { sendError(status, null); } @Override - public void sendError(int status, String message) throws IOException { + public void sendError(int status, String message) { this.status = status; this.message = message; this.hasErrorToSend = true;