diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java index abfd2222eec..4c8a51dd417 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java index 48276ae6ecb..c3a3decbf05 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java index 788ce64accb..64bf06f367d 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java index d9a9b2085c6..62c6156c5ba 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc b/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc index 05226419ddb..dce0c184372 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc @@ -142,9 +142,9 @@ Their purpose is to load resources (`.class` files etc.) from nested jar files o files in directories (as opposed to explicitly on the classpath). In the case of the `[Jar|War]Launcher` the nested paths are fixed (`+lib/*.jar+` and `+lib-provided/*.jar+` for the war case) so you just add extra jars in those locations if you want more. The -`PropertiesLauncher` looks in `lib/` in your application archive by default, but you can add additional locations by -setting an environment variable `LOADER_PATH` or `loader.path` in `application.properties` -(comma-separated list of directories or archives). +`PropertiesLauncher` looks in `lib/` in your application archive by default, but you can +add additional locations by setting an environment variable `LOADER_PATH` or `loader.path` +in `application.properties` (comma-separated list of directories or archives). diff --git a/spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/MultiProjectRepackagingTests.java b/spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/MultiProjectRepackagingTests.java index 2666bc510ac..21cc2d660b9 100644 --- a/spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/MultiProjectRepackagingTests.java +++ b/spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/MultiProjectRepackagingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,4 +76,5 @@ public class MultiProjectRepackagingTests { assertThat(jarFile.getEntry("lib/projectB.jar"), notNullValue()); jarFile.close(); } + } diff --git a/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/EmbeddedJarStarter.java b/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/EmbeddedJarStarter.java index 12936e2c706..5c29654a628 100644 --- a/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/EmbeddedJarStarter.java +++ b/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/EmbeddedJarStarter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext /** * Main class to start the embedded server. * - * @author Phillip Webb + * @author Dave Syer */ public final class EmbeddedJarStarter { @@ -30,4 +30,5 @@ public final class EmbeddedJarStarter { context.getBean(SpringConfiguration.class).run(args); context.close(); } + } diff --git a/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/SpringConfiguration.java b/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/SpringConfiguration.java index 54e39662f25..5396340644a 100644 --- a/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/SpringConfiguration.java +++ b/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/SpringConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,19 +27,19 @@ import org.springframework.core.io.support.PropertiesLoaderUtils; /** * Spring configuration. * - * @author Phillip Webb + * @author Dave Syer */ @Configuration @ComponentScan public class SpringConfiguration { - + private String message = "Jar"; - + @PostConstruct public void init() throws IOException { String value = PropertiesLoaderUtils.loadAllProperties("application.properties").getProperty("message"); if (value!=null) { - this.message = value; + this.message = value; } } @@ -48,6 +48,4 @@ public class SpringConfiguration { System.err.println("Hello Embedded " + this.message + "!"); } - - } diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java index 2cd66f0073d..75f0f16c65c 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -553,7 +553,7 @@ public class PropertiesLauncher extends Launcher { urls.addAll(index + 1, extra); } } - catch (Exception e) { + catch (Exception ex) { // ignore } } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java b/spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java index 310294a3ffc..fdf3f657ac2 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -266,7 +266,7 @@ public class ErrorPageFilter extends AbstractConfigurableEmbeddedServletContaine private String message; - private boolean errorToSend = false; + private boolean hasErrorToSend = false; public ErrorWrapperResponse(HttpServletResponse response) { super(response); @@ -281,25 +281,23 @@ public class ErrorPageFilter extends AbstractConfigurableEmbeddedServletContaine public void sendError(int status, String message) throws IOException { this.status = status; this.message = message; - this.errorToSend = true; + this.hasErrorToSend = true; // Do not call super because the container may prevent us from handling the // error ourselves } @Override public int getStatus() { - if (this.errorToSend) { + if (this.hasErrorToSend) { return this.status; } - else { - // If there was no error we need to trust the wrapped response - return super.getStatus(); - } + // If there was no error we need to trust the wrapped response + return super.getStatus(); } @Override public void flushBuffer() throws IOException { - if (this.errorToSend && !isCommitted()) { + if (this.hasErrorToSend && !isCommitted()) { ((HttpServletResponse) getResponse()) .sendError(this.status, this.message); } diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java index a3824c9728c..605bfaa19d0 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java @@ -124,7 +124,7 @@ public class LoggingApplicationListener implements SmartApplicationListener { return isAssignableFrom(sourceType, SOURCE_TYPES); } - private boolean isAssignableFrom(Class type, Class[] supportedTypes) { + private boolean isAssignableFrom(Class type, Class... supportedTypes) { for (Class supportedType : supportedTypes) { if (supportedType.isAssignableFrom(type)) { return true; @@ -139,7 +139,7 @@ public class LoggingApplicationListener implements SmartApplicationListener { onApplicationStartedEvent((ApplicationStartedEvent) event); } else if (event instanceof ApplicationEnvironmentPreparedEvent) { - onApplicationPreparedEvent((ApplicationEnvironmentPreparedEvent) event); + onApplicationEnvironmentPreparedEvent((ApplicationEnvironmentPreparedEvent) event); } else if (event instanceof ContextClosedEvent) { onContextClosedEvent(); @@ -152,7 +152,8 @@ public class LoggingApplicationListener implements SmartApplicationListener { this.loggingSystem.beforeInitialize(); } - private void onApplicationPreparedEvent(ApplicationEnvironmentPreparedEvent event) { + private void onApplicationEnvironmentPreparedEvent( + ApplicationEnvironmentPreparedEvent event) { if (this.loggingSystem == null) { this.loggingSystem = LoggingSystem.get(event.getSpringApplication() .getClassLoader()); diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystem.java b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystem.java index f4f64f145a0..f73477091bb 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystem.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystem.java @@ -72,7 +72,6 @@ public abstract class LoggingSystem { * should override this method to perform any logging system-specific cleanup. */ public void cleanUp() { - } /** diff --git a/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterIntegrationTests.java b/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterIntegrationTests.java index 34e5041ce73..66a9a3bfdb2 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterIntegrationTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; /** + * Integration tests for {@link ErrorPageFilter}. * * @author Dave Syer */ @@ -120,6 +121,7 @@ public class ErrorPageFilterIntegrationTests { public HelloWorldController helloWorldController() { return new HelloWorldController(); } + } @Controller diff --git a/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java b/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java index 30fcce05566..f83be0f6c05 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.