Skip to content

Commit

Permalink
Polish "Simplify code"
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed Sep 27, 2019
1 parent 4d0da4b commit a13666d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ boolean isZip(File file) {
}

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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
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;
Expand Down Expand Up @@ -544,7 +543,7 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat) {
@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();
}
Expand Down

0 comments on commit a13666d

Please sign in to comment.