Skip to content

Commit 4d0da4b

Browse files
Scott-YuYanphilwebb
authored andcommittedSep 27, 2019
Simplify code
See spring-projectsgh-18342
1 parent a0957d9 commit 4d0da4b

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
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 (int i = 0; i < ZIP_FILE_HEADER.length; i++) {
147-
if (inputStream.read() != ZIP_FILE_HEADER[i]) {
146+
for (byte b : ZIP_FILE_HEADER) {
147+
if (inputStream.read() != b) {
148148
return false;
149149
}
150150
}

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

+1-8
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,7 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat) {
544544
@Test
545545
void registerJspServletWithDefaultLoadOnStartup() {
546546
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);
547-
factory.addInitializers(new ServletContextInitializer() {
548-
549-
@Override
550-
public void onStartup(ServletContext servletContext) throws ServletException {
551-
servletContext.addServlet("manually-registered-jsp-servlet", JspServlet.class);
552-
}
553-
554-
});
547+
factory.addInitializers(servletContext -> servletContext.addServlet("manually-registered-jsp-servlet", JspServlet.class));
555548
this.webServer = factory.getWebServer();
556549
this.webServer.start();
557550
}

0 commit comments

Comments
 (0)