diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ErrorMvcAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ErrorMvcAutoConfiguration.java index 679936bae9..4b3185a6c2 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ErrorMvcAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ErrorMvcAutoConfiguration.java @@ -28,11 +28,11 @@ import org.springframework.boot.actuate.web.BasicErrorController; import org.springframework.boot.actuate.web.ErrorController; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration.DefaultTemplateResolverConfiguration; import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration; @@ -103,7 +103,8 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom context.getClassLoader())) { if (DefaultTemplateResolverConfiguration.templateExists( context.getEnvironment(), context.getResourceLoader(), "error")) { - return ConditionOutcome.noMatch("Thymeleaf template found for error view"); + return ConditionOutcome + .noMatch("Thymeleaf template found for error view"); } } // FIXME: add matcher for JSP view if Jasper detected @@ -128,6 +129,7 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom this.context.addPropertyAccessor(new MapAccessor()); this.helper = new PropertyPlaceholderHelper("${", "}"); this.resolver = new PlaceholderResolver() { + @Override public String resolvePlaceholder(String name) { Expression expression = SpelView.this.parser.parseExpression(name); Object value = expression.getValue(SpelView.this.context); @@ -136,10 +138,12 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom }; } + @Override public String getContentType() { return "text/html"; } + @Override public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { if (response.getContentType() == null) { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java index fb3346f621..6a19960ee2 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/SimpleHealthIndicator.java @@ -72,6 +72,7 @@ public class SimpleHealthIndicator implements HealthIndicator 0) { - return ConditionOutcome.match("Existing bean configured database detected"); + return ConditionOutcome + .match("Existing bean configured database detected"); } return ConditionOutcome.noMatch("no existing bean configured database"); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationReportLoggingInitializerTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationReportLoggingInitializerTests.java index 65618d56e4..1184df4c1e 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationReportLoggingInitializerTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationReportLoggingInitializerTests.java @@ -48,7 +48,7 @@ import static org.mockito.Mockito.mock; /** * Tests for {@link AutoConfigurationReportLoggingInitializer}. - * + * * @author Phillip Webb */ public class AutoConfigurationReportLoggingInitializerTests { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/JpaRepositoriesAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/JpaRepositoriesAutoConfigurationTests.java index 5bd24ce40b..0bdc4b2249 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/JpaRepositoriesAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/JpaRepositoriesAutoConfigurationTests.java @@ -34,7 +34,7 @@ import static org.junit.Assert.assertNotNull; /** * Tests for {@link JpaRepositoriesAutoConfiguration}. - * + * * @author Dave Syer */ public class JpaRepositoriesAutoConfigurationTests { @@ -46,7 +46,8 @@ public class JpaRepositoriesAutoConfigurationTests { this.context = new AnnotationConfigApplicationContext(); this.context.register(TestConfiguration.class, ComponentScanDetectorConfiguration.class, - EmbeddedDataSourceConfiguration.class, HibernateJpaAutoConfiguration.class, + EmbeddedDataSourceConfiguration.class, + HibernateJpaAutoConfiguration.class, JpaRepositoriesAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); this.context.refresh(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsTemplateAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsTemplateAutoConfigurationTests.java index d477ffcba8..f3af2137af 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsTemplateAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsTemplateAutoConfigurationTests.java @@ -55,7 +55,10 @@ public class JmsTemplateAutoConfigurationTests { assertNotNull(jmsTemplate); assertNotNull(connectionFactory); assertEquals(jmsTemplate.getConnectionFactory(), connectionFactory); - assertEquals(((ActiveMQConnectionFactory)jmsTemplate.getConnectionFactory()).getBrokerURL(), "vm://localhost"); + assertEquals( + ((ActiveMQConnectionFactory) jmsTemplate.getConnectionFactory()) + .getBrokerURL(), + "vm://localhost"); } @Test @@ -109,7 +112,7 @@ public class JmsTemplateAutoConfigurationTests { JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class); assertFalse(jmsTemplate.isPubSubDomain()); } - + @Test public void testJmsTemplateOverridden() { this.context = new AnnotationConfigApplicationContext(); @@ -139,7 +142,9 @@ public class JmsTemplateAutoConfigurationTests { assertNotNull(jmsTemplate); assertNotNull(connectionFactory); assertEquals(jmsTemplate.getConnectionFactory(), connectionFactory); - assertEquals(((ActiveMQConnectionFactory)jmsTemplate.getConnectionFactory()).getBrokerURL(), + assertEquals( + ((ActiveMQConnectionFactory) jmsTemplate.getConnectionFactory()) + .getBrokerURL(), "tcp://localhost:61616"); } @@ -157,7 +162,9 @@ public class JmsTemplateAutoConfigurationTests { assertNotNull(jmsTemplate); assertNotNull(connectionFactory); assertEquals(jmsTemplate.getConnectionFactory(), connectionFactory); - assertEquals(((ActiveMQConnectionFactory)jmsTemplate.getConnectionFactory()).getBrokerURL(), + assertEquals( + ((ActiveMQConnectionFactory) jmsTemplate.getConnectionFactory()) + .getBrokerURL(), "tcp://remote-host:10000"); } @@ -174,7 +181,8 @@ public class JmsTemplateAutoConfigurationTests { assertNotNull(jmsTemplate); assertNotNull(pool); assertEquals(jmsTemplate.getConnectionFactory(), pool); - ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory) pool.getConnectionFactory(); + ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory) pool + .getConnectionFactory(); assertEquals("vm://localhost", factory.getBrokerURL()); } @@ -192,7 +200,8 @@ public class JmsTemplateAutoConfigurationTests { assertNotNull(jmsTemplate); assertNotNull(pool); assertEquals(jmsTemplate.getConnectionFactory(), pool); - ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory) pool.getConnectionFactory(); + ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory) pool + .getConnectionFactory(); assertEquals("tcp://localhost:61616", factory.getBrokerURL()); } @@ -202,7 +211,8 @@ public class JmsTemplateAutoConfigurationTests { this.context .register(TestConfiguration.class, JmsTemplateAutoConfiguration.class); TestUtils.addEnviroment(this.context, "spring.activemq.pooled:true", - "spring.activemq.inMemory:false", "spring.activemq.brokerURL:tcp://remote-host:10000"); + "spring.activemq.inMemory:false", + "spring.activemq.brokerURL:tcp://remote-host:10000"); this.context.refresh(); JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class); PooledConnectionFactory pool = this.context @@ -210,7 +220,8 @@ public class JmsTemplateAutoConfigurationTests { assertNotNull(jmsTemplate); assertNotNull(pool); assertEquals(jmsTemplate.getConnectionFactory(), pool); - ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory) pool.getConnectionFactory(); + ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory) pool + .getConnectionFactory(); assertEquals("tcp://remote-host:10000", factory.getBrokerURL()); } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceResolverAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceResolverAutoConfigurationTests.java index e4cb0def85..25e46bb9d1 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceResolverAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/DeviceResolverAutoConfigurationTests.java @@ -39,7 +39,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl /** * Tests for {@link DeviceResolverAutoConfiguration}. - * + * * @author Roy Clarkson */ public class DeviceResolverAutoConfigurationTests { diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/OptionHandler.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/OptionHandler.java index 4b61ece86d..194eb054c4 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/OptionHandler.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/OptionHandler.java @@ -133,6 +133,7 @@ public class OptionHandler { @Override public String format(Map options) { Comparator comparator = new Comparator() { + @Override public int compare(OptionDescriptor first, OptionDescriptor second) { return first.options().iterator().next() .compareTo(second.options().iterator().next()); diff --git a/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/org/springframework/boot/sample/ops/ui/SampleActuatorUiApplicationPortTests.java b/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/org/springframework/boot/sample/ops/ui/SampleActuatorUiApplicationPortTests.java index 4ca1331ebf..c05db04bf0 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/org/springframework/boot/sample/ops/ui/SampleActuatorUiApplicationPortTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/org/springframework/boot/sample/ops/ui/SampleActuatorUiApplicationPortTests.java @@ -58,8 +58,8 @@ public class SampleActuatorUiApplicationPortTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication - .run(SampleActuatorUiApplication.class, args); + return SpringApplication.run( + SampleActuatorUiApplication.class, args); } }); context = future.get(60, TimeUnit.SECONDS); diff --git a/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/org/springframework/boot/sample/ops/ui/SampleActuatorUiApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/org/springframework/boot/sample/ops/ui/SampleActuatorUiApplicationTests.java index de1fb02d67..8960d3c259 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/org/springframework/boot/sample/ops/ui/SampleActuatorUiApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/org/springframework/boot/sample/ops/ui/SampleActuatorUiApplicationTests.java @@ -58,7 +58,7 @@ public class SampleActuatorUiApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(SampleActuatorUiApplication.class); } }); @@ -112,8 +112,10 @@ public class SampleActuatorUiApplicationTests { .contains("")); assertTrue("Wrong body:\n" + entity.getBody(), entity.getBody() .contains("")); - assertTrue("Wrong body:\n" + entity.getBody(), entity.getBody() - .contains("Please contact the operator with the above information")); + assertTrue( + "Wrong body:\n" + entity.getBody(), + entity.getBody().contains( + "Please contact the operator with the above information")); } private RestTemplate getRestTemplate() { diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/EndpointsPropertiesSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/EndpointsPropertiesSampleActuatorApplicationTests.java index eaf1d9219a..5dad069baa 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/EndpointsPropertiesSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/EndpointsPropertiesSampleActuatorApplicationTests.java @@ -59,8 +59,7 @@ public class EndpointsPropertiesSampleActuatorApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication - .run(configuration, args); + return SpringApplication.run(configuration, args); } }); this.context = future.get(60, TimeUnit.SECONDS); diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ManagementAddressSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ManagementAddressSampleActuatorApplicationTests.java index 557561f9c8..335bdc6a1c 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ManagementAddressSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ManagementAddressSampleActuatorApplicationTests.java @@ -67,8 +67,8 @@ public class ManagementAddressSampleActuatorApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication - .run(SampleActuatorApplication.class, args); + return SpringApplication.run( + SampleActuatorApplication.class, args); } }); context = future.get(60, TimeUnit.SECONDS); diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ManagementSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ManagementSampleActuatorApplicationTests.java index 8d5f4a1fff..e54fef2bee 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ManagementSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ManagementSampleActuatorApplicationTests.java @@ -57,8 +57,8 @@ public class ManagementSampleActuatorApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication - .run(SampleActuatorApplication.class, args); + return SpringApplication.run( + SampleActuatorApplication.class, args); } }); context = future.get(60, TimeUnit.SECONDS); diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/NoManagementSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/NoManagementSampleActuatorApplicationTests.java index b25944caf3..8faeb7d984 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/NoManagementSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/NoManagementSampleActuatorApplicationTests.java @@ -65,8 +65,8 @@ public class NoManagementSampleActuatorApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication - .run(SampleActuatorApplication.class, args); + return SpringApplication.run( + SampleActuatorApplication.class, args); } }); context = future.get(60, TimeUnit.SECONDS); diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/SampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/SampleActuatorApplicationTests.java index 93959fa255..b06678150f 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/SampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/SampleActuatorApplicationTests.java @@ -69,7 +69,7 @@ public class SampleActuatorApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(SampleActuatorApplication.class); } }); @@ -145,8 +145,7 @@ public class SampleActuatorApplicationTests { assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, entity.getStatusCode()); String body = entity.getBody(); assertNotNull(body); - assertTrue("Wrong body: " + body, - body.contains("\"error\":")); + assertTrue("Wrong body: " + body, body.contains("\"error\":")); } @Test @@ -171,7 +170,7 @@ public class SampleActuatorApplicationTests { .getForEntity("http://localhost:8080/trace", List.class); assertEquals(HttpStatus.OK, entity.getStatusCode()); @SuppressWarnings("unchecked") - List> list = (List>) entity.getBody(); + List> list = entity.getBody(); Map trace = list.get(list.size() - 1); @SuppressWarnings("unchecked") Map map = (Map) ((Map) ((Map) trace diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ShutdownSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ShutdownSampleActuatorApplicationTests.java index fa06dd251c..853d195323 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ShutdownSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/ShutdownSampleActuatorApplicationTests.java @@ -62,7 +62,7 @@ public class ShutdownSampleActuatorApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(SampleActuatorApplication.class); } }); diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/UnsecureManagementSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/UnsecureManagementSampleActuatorApplicationTests.java index 1d100914c0..e26b9742bc 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/UnsecureManagementSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/UnsecureManagementSampleActuatorApplicationTests.java @@ -41,7 +41,7 @@ import org.springframework.web.client.RestTemplate; /** * Integration tests for unsecured service endpoints (even with Spring Security on * classpath). - * + * * @author Dave Syer */ public class UnsecureManagementSampleActuatorApplicationTests { @@ -55,9 +55,9 @@ public class UnsecureManagementSampleActuatorApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication - .run(SampleActuatorApplication.class, - "--security.management.enabled=false"); + return SpringApplication.run( + SampleActuatorApplication.class, + "--security.management.enabled=false"); } }); context = future.get(60, TimeUnit.SECONDS); @@ -87,7 +87,8 @@ public class UnsecureManagementSampleActuatorApplicationTests { public void testMetrics() throws Exception { try { testHomeIsSecure(); // makes sure some requests have been made - } catch (AssertionError ex) { + } + catch (AssertionError ex) { // ignore; } @SuppressWarnings("rawtypes") diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/UnsecureSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/UnsecureSampleActuatorApplicationTests.java index 088e9dfa6b..9a2516cfd8 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/UnsecureSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/org/springframework/boot/sample/ops/UnsecureSampleActuatorApplicationTests.java @@ -54,9 +54,9 @@ public class UnsecureSampleActuatorApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication - .run(SampleActuatorApplication.class, - "--security.basic.enabled=false"); + return SpringApplication.run( + SampleActuatorApplication.class, + "--security.basic.enabled=false"); } }); context = future.get(60, TimeUnit.SECONDS); diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/org/springframework/boot/sample/data/jpa/web/SampleController.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/org/springframework/boot/sample/data/jpa/web/SampleController.java index c572acb4cc..7c8bfd0d3c 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/org/springframework/boot/sample/data/jpa/web/SampleController.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/org/springframework/boot/sample/data/jpa/web/SampleController.java @@ -31,7 +31,7 @@ public class SampleController { @RequestMapping("/") @ResponseBody - @Transactional(readOnly = true) + @Transactional(readOnly = true) public String helloWorld() { return this.cityService.getCity("Bath", "UK").getName(); } diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/SampleDataJpaApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/SampleDataJpaApplicationTests.java index 1bef1cd21c..6560b19a21 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/SampleDataJpaApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/SampleDataJpaApplicationTests.java @@ -23,9 +23,10 @@ import org.springframework.web.context.WebApplicationContext; * @author Oliver Gierke */ @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = SampleDataJpaApplication.class, loader=SpringApplicationContextLoader.class) +@ContextConfiguration(classes = SampleDataJpaApplication.class, loader = SpringApplicationContextLoader.class) @WebAppConfiguration -@ActiveProfiles("scratch") // Separate profile for web tests to avoid clashing databases +@ActiveProfiles("scratch") +// Separate profile for web tests to avoid clashing databases public class SampleDataJpaApplicationTests { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/service/CityRepositoryIntegrationTests.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/service/CityRepositoryIntegrationTests.java index 9b1d5d723b..1b263beb1c 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/service/CityRepositoryIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/service/CityRepositoryIntegrationTests.java @@ -36,7 +36,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; * @author Oliver Gierke */ @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = SampleDataJpaApplication.class, loader=SpringApplicationContextLoader.class) +@ContextConfiguration(classes = SampleDataJpaApplication.class, loader = SpringApplicationContextLoader.class) public class CityRepositoryIntegrationTests { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/service/HotelRepositoryIntegrationTests.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/service/HotelRepositoryIntegrationTests.java index 1d7faadc2a..bbc86e4811 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/service/HotelRepositoryIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/org/springframework/boot/sample/data/jpa/service/HotelRepositoryIntegrationTests.java @@ -44,7 +44,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; * @author Oliver Gierke */ @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = SampleDataJpaApplication.class, loader=SpringApplicationContextLoader.class) +@ContextConfiguration(classes = SampleDataJpaApplication.class, loader = SpringApplicationContextLoader.class) public class HotelRepositoryIntegrationTests { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/org/springframework/boot/sample/data/mongo/Customer.java b/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/org/springframework/boot/sample/data/mongo/Customer.java index 8cfc24facd..a99bed6d40 100644 --- a/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/org/springframework/boot/sample/data/mongo/Customer.java +++ b/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/org/springframework/boot/sample/data/mongo/Customer.java @@ -20,25 +20,24 @@ import org.springframework.data.annotation.Id; public class Customer { - @Id - private String id; + @Id + private String id; - private String firstName; - private String lastName; + private String firstName; + private String lastName; - public Customer() {} + public Customer() { + } - public Customer(String firstName, String lastName) { - this.firstName = firstName; - this.lastName = lastName; - } + public Customer(String firstName, String lastName) { + this.firstName = firstName; + this.lastName = lastName; + } - @Override - public String toString() { - return String.format( - "Customer[id=%s, firstName='%s', lastName='%s']", - id, firstName, lastName); - } + @Override + public String toString() { + return String.format("Customer[id=%s, firstName='%s', lastName='%s']", id, + firstName, lastName); + } } - diff --git a/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/org/springframework/boot/sample/data/mongo/CustomerRepository.java b/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/org/springframework/boot/sample/data/mongo/CustomerRepository.java index 2dd05f6116..90b44f0161 100644 --- a/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/org/springframework/boot/sample/data/mongo/CustomerRepository.java +++ b/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/org/springframework/boot/sample/data/mongo/CustomerRepository.java @@ -22,8 +22,8 @@ import org.springframework.data.mongodb.repository.MongoRepository; public interface CustomerRepository extends MongoRepository { - public Customer findByFirstName(String firstName); + public Customer findByFirstName(String firstName); - public List findByLastName(String lastName); + public List findByLastName(String lastName); } diff --git a/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/org/springframework/boot/sample/data/mongo/SampleMongoApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/org/springframework/boot/sample/data/mongo/SampleMongoApplicationTests.java index 81db13d43e..4ae9c384cb 100644 --- a/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/org/springframework/boot/sample/data/mongo/SampleMongoApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/org/springframework/boot/sample/data/mongo/SampleMongoApplicationTests.java @@ -27,7 +27,7 @@ import org.springframework.core.NestedCheckedException; /** * Tests for {@link SampleMongoApplication}. - * + * * @author Dave Syer */ public class SampleMongoApplicationTests { @@ -39,13 +39,15 @@ public class SampleMongoApplicationTests { public void testDefaultSettings() throws Exception { try { SampleMongoApplication.main(new String[0]); - } catch (IllegalStateException ex) { + } + catch (IllegalStateException ex) { if (serverNotRunning(ex)) { return; } } String output = this.outputCapture.toString(); - assertTrue("Wrong output: " + output, output.contains("firstName='Alice', lastName='Smith'")); + assertTrue("Wrong output: " + output, + output.contains("firstName='Alice', lastName='Smith'")); } private boolean serverNotRunning(IllegalStateException e) { diff --git a/spring-boot-samples/spring-boot-sample-integration/src/test/java/org/springframework/boot/sample/integration/consumer/SampleIntegrationApplicationTests.java b/spring-boot-samples/spring-boot-sample-integration/src/test/java/org/springframework/boot/sample/integration/consumer/SampleIntegrationApplicationTests.java index c9143c5610..d03a4f80f5 100644 --- a/spring-boot-samples/spring-boot-sample-integration/src/test/java/org/springframework/boot/sample/integration/consumer/SampleIntegrationApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-integration/src/test/java/org/springframework/boot/sample/integration/consumer/SampleIntegrationApplicationTests.java @@ -46,8 +46,7 @@ public class SampleIntegrationApplicationTests { @BeforeClass public static void start() throws Exception { - context = (ConfigurableApplicationContext) SpringApplication - .run(SampleIntegrationApplication.class); + context = SpringApplication.run(SampleIntegrationApplication.class); } @AfterClass diff --git a/spring-boot-samples/spring-boot-sample-jetty/src/test/java/org/springframework/boot/sample/jetty/SampleJettyApplicationTests.java b/spring-boot-samples/spring-boot-sample-jetty/src/test/java/org/springframework/boot/sample/jetty/SampleJettyApplicationTests.java index d06dfe304e..c8be5c5c4d 100644 --- a/spring-boot-samples/spring-boot-sample-jetty/src/test/java/org/springframework/boot/sample/jetty/SampleJettyApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-jetty/src/test/java/org/springframework/boot/sample/jetty/SampleJettyApplicationTests.java @@ -51,7 +51,7 @@ public class SampleJettyApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(SampleJettyApplication.class); } }); diff --git a/spring-boot-samples/spring-boot-sample-simple/src/test/java/org/springframework/boot/sample/simple/SpringTestSampleSimpleApplicationTests.java b/spring-boot-samples/spring-boot-sample-simple/src/test/java/org/springframework/boot/sample/simple/SpringTestSampleSimpleApplicationTests.java index 28878f458a..2d4c8db807 100644 --- a/spring-boot-samples/spring-boot-sample-simple/src/test/java/org/springframework/boot/sample/simple/SpringTestSampleSimpleApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-simple/src/test/java/org/springframework/boot/sample/simple/SpringTestSampleSimpleApplicationTests.java @@ -28,7 +28,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; * @author Dave Syer */ @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = SampleSimpleApplication.class, loader=SpringApplicationContextLoader.class) +@ContextConfiguration(classes = SampleSimpleApplication.class, loader = SpringApplicationContextLoader.class) public class SpringTestSampleSimpleApplicationTests { @Test diff --git a/spring-boot-samples/spring-boot-sample-tomcat/src/test/java/org/springframework/boot/sample/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java b/spring-boot-samples/spring-boot-sample-tomcat/src/test/java/org/springframework/boot/sample/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java index 6d08ca819d..d6054b521a 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat/src/test/java/org/springframework/boot/sample/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-tomcat/src/test/java/org/springframework/boot/sample/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java @@ -73,7 +73,7 @@ public class NonAutoConfigurationSampleTomcatApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(NonAutoConfigurationSampleTomcatApplication.class); } }); diff --git a/spring-boot-samples/spring-boot-sample-tomcat/src/test/java/org/springframework/boot/sample/tomcat/SampleTomcatApplicationTests.java b/spring-boot-samples/spring-boot-sample-tomcat/src/test/java/org/springframework/boot/sample/tomcat/SampleTomcatApplicationTests.java index 921a9ede03..d2f2ba8e8b 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat/src/test/java/org/springframework/boot/sample/tomcat/SampleTomcatApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-tomcat/src/test/java/org/springframework/boot/sample/tomcat/SampleTomcatApplicationTests.java @@ -51,7 +51,7 @@ public class SampleTomcatApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(SampleTomcatApplication.class); } }); diff --git a/spring-boot-samples/spring-boot-sample-traditional/src/test/java/org/springframework/boot/sample/traditional/SampleTraditionalApplicationTests.java b/spring-boot-samples/spring-boot-sample-traditional/src/test/java/org/springframework/boot/sample/traditional/SampleTraditionalApplicationTests.java index a42b48aa15..032ae71143 100644 --- a/spring-boot-samples/spring-boot-sample-traditional/src/test/java/org/springframework/boot/sample/traditional/SampleTraditionalApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-traditional/src/test/java/org/springframework/boot/sample/traditional/SampleTraditionalApplicationTests.java @@ -52,7 +52,7 @@ public class SampleTraditionalApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(SampleTraditionalApplication.class); } }); diff --git a/spring-boot-samples/spring-boot-sample-web-jsp/src/test/java/org/springframework/boot/sample/jsp/SampleWebJspApplicationTests.java b/spring-boot-samples/spring-boot-sample-web-jsp/src/test/java/org/springframework/boot/sample/jsp/SampleWebJspApplicationTests.java index 3eda54cd91..a50aef25d1 100644 --- a/spring-boot-samples/spring-boot-sample-web-jsp/src/test/java/org/springframework/boot/sample/jsp/SampleWebJspApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-web-jsp/src/test/java/org/springframework/boot/sample/jsp/SampleWebJspApplicationTests.java @@ -21,7 +21,7 @@ import static org.junit.Assert.*; /** * Basic integration tests for JSP application. - * + * * @author Phillip Webb */ public class SampleWebJspApplicationTests { @@ -35,7 +35,7 @@ public class SampleWebJspApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(SampleWebJspApplication.class); } }); @@ -54,8 +54,8 @@ public class SampleWebJspApplicationTests { ResponseEntity entity = getRestTemplate().getForEntity( "http://localhost:8080", String.class); assertEquals(HttpStatus.OK, entity.getStatusCode()); - assertTrue("Wrong body:\n" + entity.getBody(), entity - .getBody().contains("/resources/text.txt")); + assertTrue("Wrong body:\n" + entity.getBody(), + entity.getBody().contains("/resources/text.txt")); } private RestTemplate getRestTemplate() { diff --git a/spring-boot-samples/spring-boot-sample-web-static/src/test/java/org/springframework/boot/sample/ui/SampleWebStaticApplicationTests.java b/spring-boot-samples/spring-boot-sample-web-static/src/test/java/org/springframework/boot/sample/ui/SampleWebStaticApplicationTests.java index c39f4d4669..c9c0242d74 100644 --- a/spring-boot-samples/spring-boot-sample-web-static/src/test/java/org/springframework/boot/sample/ui/SampleWebStaticApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-web-static/src/test/java/org/springframework/boot/sample/ui/SampleWebStaticApplicationTests.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue; /** * Basic integration tests for demo application. - * + * * @author Dave Syer */ public class SampleWebStaticApplicationTests { @@ -37,7 +37,7 @@ public class SampleWebStaticApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(SampleWebStaticApplication.class); } }); diff --git a/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/org/springframework/boot/sample/ui/SampleWebUiApplicationTests.java b/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/org/springframework/boot/sample/ui/SampleWebUiApplicationTests.java index 3bc91f01fd..f007890092 100644 --- a/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/org/springframework/boot/sample/ui/SampleWebUiApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/org/springframework/boot/sample/ui/SampleWebUiApplicationTests.java @@ -26,7 +26,7 @@ import static org.junit.Assert.assertTrue; /** * Basic integration tests for demo application. - * + * * @author Dave Syer */ public class SampleWebUiApplicationTests { @@ -40,7 +40,7 @@ public class SampleWebUiApplicationTests { new Callable() { @Override public ConfigurableApplicationContext call() throws Exception { - return (ConfigurableApplicationContext) SpringApplication + return SpringApplication .run(SampleWebUiApplication.class); } }); diff --git a/spring-boot-samples/spring-boot-sample-websocket/src/main/java/org/springframework/boot/samples/websocket/config/SampleWebSocketsApplication.java b/spring-boot-samples/spring-boot-sample-websocket/src/main/java/org/springframework/boot/samples/websocket/config/SampleWebSocketsApplication.java index daebe593a5..d6c261528c 100644 --- a/spring-boot-samples/spring-boot-sample-websocket/src/main/java/org/springframework/boot/samples/websocket/config/SampleWebSocketsApplication.java +++ b/spring-boot-samples/spring-boot-sample-websocket/src/main/java/org/springframework/boot/samples/websocket/config/SampleWebSocketsApplication.java @@ -37,8 +37,8 @@ public class SampleWebSocketsApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(SampleWebSocketsApplication.class); - } + return application.sources(SampleWebSocketsApplication.class); + } public static void main(String[] args) { SpringApplication.run(SampleWebSocketsApplication.class, args); diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPlugin.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPlugin.java index 6b50fefe1e..aec35a5a5c 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPlugin.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPlugin.java @@ -26,7 +26,7 @@ import org.springframework.boot.gradle.task.RunJar; /** * Gradle 'Spring Boot' {@link Plugin}. - * + * * @author Phillip Webb */ public class SpringBootPlugin implements Plugin { @@ -53,12 +53,14 @@ public class SpringBootPlugin implements Plugin { } private Repackage addRepackageTask(Project project) { - Repackage packageTask = project.getTasks().create(REPACKAGE_TASK_NAME, Repackage.class); + Repackage packageTask = project.getTasks().create(REPACKAGE_TASK_NAME, + Repackage.class); packageTask.setDescription("Repackage existing JAR and WAR " - + "archives so that they can be executed from the command " + "line using 'java -jar'"); + + "archives so that they can be executed from the command " + + "line using 'java -jar'"); packageTask.setGroup(BasePlugin.BUILD_GROUP); - packageTask.dependsOn(project.getConfigurations().getByName(Dependency.ARCHIVES_CONFIGURATION) - .getAllArtifacts().getBuildDependencies()); + packageTask.dependsOn(project.getConfigurations().getByName( + Dependency.ARCHIVES_CONFIGURATION).getAllArtifacts().getBuildDependencies()); return packageTask; } diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java index 6e013e33d8..a2aac00d8c 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java @@ -1,3 +1,4 @@ + package org.springframework.boot.gradle.task; import java.io.File; @@ -23,6 +24,7 @@ class ProjectLibraries implements Libraries { /** * Create a new {@link ProjectLibraries} instance of the specified {@link Project}. + * * @param project the gradle project */ public ProjectLibraries(Project project) { @@ -31,6 +33,7 @@ class ProjectLibraries implements Libraries { /** * Set the name of the provided configuration. Defaults to 'providedRuntime'. + * * @param providedConfigurationName the providedConfigurationName to set */ public void setProvidedConfigurationName(String providedConfigurationName) { diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java index b7446f0902..afb20574fc 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java @@ -29,7 +29,7 @@ import org.springframework.boot.loader.tools.Repackager; /** * Repackage task. - * + * * @author Phillip Webb */ public class Repackage extends DefaultTask { @@ -44,6 +44,7 @@ public class Repackage extends DefaultTask { libraries.setProvidedConfigurationName(extension.getProvidedConfiguration()); } project.getTasks().withType(Jar.class, new Action() { + @Override public void execute(Jar archive) { if ("".equals(archive.getClassifier())) { diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunJar.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunJar.java index 3ff8bf3b07..3e6f49a70c 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunJar.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunJar.java @@ -29,7 +29,7 @@ import org.gradle.process.internal.ExecAction; /** * Run Jar task. Run the built jar file from Gradle. - * + * * @author Dave Noel */ public class RunJar extends DefaultTask { @@ -40,6 +40,7 @@ public class RunJar extends DefaultTask { public void runJar() { Project project = getProject(); project.getTasks().withType(Jar.class, new Action() { + @Override public void execute(Jar archive) { file = archive.getArchivePath(); diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java index 26cf139e37..60f90fd591 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java @@ -200,6 +200,7 @@ class JarWriter { this.close = close; } + @Override public void write(OutputStream outputStream) throws IOException { byte[] buffer = new byte[BUFFER_SIZE]; int bytesRead = -1; diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java index e0e9f56519..910eabd1b0 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java @@ -157,6 +157,7 @@ public class LaunchedURLClassLoader extends URLClassLoader { private void definePackageForFindClass(final String name, final String packageName) { try { AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override public Object run() throws ClassNotFoundException { String path = name.replace('.', '/').concat(".class"); for (URL url : getURLs()) { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java index f2dfc8f15f..5748208458 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java @@ -142,6 +142,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements /** * Returns the port that the embedded servlet container should listen on. */ + @Override public int getPort() { return this.port; } @@ -158,10 +159,12 @@ public abstract class AbstractEmbeddedServletContainerFactory implements return this.address; } + @Override public void setSessionTimeout(int sessionTimeout) { this.sessionTimeout = sessionTimeout; } + @Override public void setSessionTimeout(int sessionTimeout, TimeUnit timeUnit) { Assert.notNull(timeUnit, "TimeUnit must not be null"); this.sessionTimeout = (int) timeUnit.toSeconds(sessionTimeout); diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedServletContainer.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedServletContainer.java index 7c15755447..8cf3e87f62 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedServletContainer.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedServletContainer.java @@ -35,6 +35,7 @@ public interface EmbeddedServletContainer { */ public static final EmbeddedServletContainer NONE = new EmbeddedServletContainer() { + @Override public void start() throws EmbeddedServletContainerException { // Do nothing }; diff --git a/spring-boot/src/main/java/org/springframework/boot/liquibase/LiquibaseServiceLocatorInitializer.java b/spring-boot/src/main/java/org/springframework/boot/liquibase/LiquibaseServiceLocatorInitializer.java index 2986b04c49..1e6c305df2 100644 --- a/spring-boot/src/main/java/org/springframework/boot/liquibase/LiquibaseServiceLocatorInitializer.java +++ b/spring-boot/src/main/java/org/springframework/boot/liquibase/LiquibaseServiceLocatorInitializer.java @@ -21,8 +21,7 @@ public class LiquibaseServiceLocatorInitializer implements ApplicationContextInitializer, SpringApplicationInitializer { - static final Log logger = LogFactory - .getLog(LiquibaseServiceLocatorInitializer.class); + static final Log logger = LogFactory.getLog(LiquibaseServiceLocatorInitializer.class); @Override public void initialize(SpringApplication springApplication, String[] args) { @@ -39,12 +38,12 @@ public class LiquibaseServiceLocatorInitializer implements * Inner class to prevent class not found issues */ private static class LiquibasePresent { - + public void replaceServiceLocator() { ServiceLocator.setInstance(new CustomResolverServiceLocator( new SpringPackageScanClassResolver())); } - + } - + } diff --git a/spring-boot/src/test/java/org/springframework/boot/config/JacksonParserTests.java b/spring-boot/src/test/java/org/springframework/boot/config/JacksonParserTests.java index 29278d5277..8a52fb9cbf 100644 --- a/spring-boot/src/test/java/org/springframework/boot/config/JacksonParserTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/config/JacksonParserTests.java @@ -16,7 +16,6 @@ package org.springframework.boot.config; - /** * Tests for {@link JsonParser}. *