Skip to content

Commit a13666d

Browse files
committed
Polish "Simplify code"
See spring-projectsgh-18342
1 parent 4d0da4b commit a13666d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ boolean isZip(File file) {
143143
}
144144

145145
private boolean isZip(InputStream inputStream) throws IOException {
146-
for (byte b : ZIP_FILE_HEADER) {
147-
if (inputStream.read() != b) {
146+
for (byte headerByte : ZIP_FILE_HEADER) {
147+
if (inputStream.read() != headerByte) {
148148
return false;
149149
}
150150
}

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
import org.springframework.boot.testsupport.system.CapturedOutput;
6969
import org.springframework.boot.web.server.PortInUseException;
7070
import org.springframework.boot.web.server.WebServerException;
71-
import org.springframework.boot.web.servlet.ServletContextInitializer;
7271
import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory;
7372
import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactoryTests;
7473
import org.springframework.core.io.ByteArrayResource;
@@ -544,7 +543,7 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat) {
544543
@Test
545544
void registerJspServletWithDefaultLoadOnStartup() {
546545
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);
547-
factory.addInitializers(servletContext -> servletContext.addServlet("manually-registered-jsp-servlet", JspServlet.class));
546+
factory.addInitializers((context) -> context.addServlet("manually-registered-jsp-servlet", JspServlet.class));
548547
this.webServer = factory.getWebServer();
549548
this.webServer.start();
550549
}

0 commit comments

Comments
 (0)