From e02521d12bacefca9b8c91b22c57b02eeee952fb Mon Sep 17 00:00:00 2001 From: vvzvvv Date: Wed, 29 Jul 2026 16:17:45 +0900 Subject: [PATCH] Remove unnecessary null check in GroovyTemplateAutoConfigurationTests The context field is final and eagerly initialized, so it can never be null at teardown time. See gh-51147 Signed-off-by: vvzvvv --- .../autoconfigure/GroovyTemplateAutoConfigurationTests.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/module/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java b/module/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java index 69687fb08762..f021fdb91d60 100644 --- a/module/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java +++ b/module/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java @@ -70,9 +70,7 @@ void setupContext() { @AfterEach void close() { LocaleContextHolder.resetLocaleContext(); - if (this.context != null) { - this.context.close(); - } + this.context.close(); } @Test