diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java index 48b42b10a63..bf6a818d342 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java @@ -143,8 +143,8 @@ class BootArchiveSupport { } private boolean isZip(InputStream inputStream) throws IOException { - for (int i = 0; i < ZIP_FILE_HEADER.length; i++) { - if (inputStream.read() != ZIP_FILE_HEADER[i]) { + for (byte b : ZIP_FILE_HEADER) { + if (inputStream.read() != b) { return false; } } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java index 941120ff5f1..2c138b96deb 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java @@ -544,14 +544,7 @@ class TomcatServletWebServerFactoryTests extends AbstractServletWebServerFactory @Test void registerJspServletWithDefaultLoadOnStartup() { TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0); - factory.addInitializers(new ServletContextInitializer() { - - @Override - public void onStartup(ServletContext servletContext) throws ServletException { - servletContext.addServlet("manually-registered-jsp-servlet", JspServlet.class); - } - - }); + factory.addInitializers(servletContext -> servletContext.addServlet("manually-registered-jsp-servlet", JspServlet.class)); this.webServer = factory.getWebServer(); this.webServer.start(); }