mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Polish "Simplify code"
See gh-18342
This commit is contained in:
parent
4d0da4b700
commit
a13666d696
@ -143,8 +143,8 @@ class BootArchiveSupport {
|
||||
}
|
||||
|
||||
private boolean isZip(InputStream inputStream) throws IOException {
|
||||
for (byte b : ZIP_FILE_HEADER) {
|
||||
if (inputStream.read() != b) {
|
||||
for (byte headerByte : ZIP_FILE_HEADER) {
|
||||
if (inputStream.read() != headerByte) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,6 @@ import org.mockito.InOrder;
|
||||
import org.springframework.boot.testsupport.system.CapturedOutput;
|
||||
import org.springframework.boot.web.server.PortInUseException;
|
||||
import org.springframework.boot.web.server.WebServerException;
|
||||
import org.springframework.boot.web.servlet.ServletContextInitializer;
|
||||
import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory;
|
||||
import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactoryTests;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
@ -544,7 +543,7 @@ class TomcatServletWebServerFactoryTests extends AbstractServletWebServerFactory
|
||||
@Test
|
||||
void registerJspServletWithDefaultLoadOnStartup() {
|
||||
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);
|
||||
factory.addInitializers(servletContext -> servletContext.addServlet("manually-registered-jsp-servlet", JspServlet.class));
|
||||
factory.addInitializers((context) -> context.addServlet("manually-registered-jsp-servlet", JspServlet.class));
|
||||
this.webServer = factory.getWebServer();
|
||||
this.webServer.start();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user