diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/HikariDataSourceConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/HikariDataSourceConfiguration.java index 618f859be8..00fa795350 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/HikariDataSourceConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/HikariDataSourceConfiguration.java @@ -40,14 +40,17 @@ import com.zaxxer.hikari.HikariDataSource; * * @author Dave Syer * @see DataSourceAutoConfiguration + * @since 1.1.0 */ @Configuration public class HikariDataSourceConfiguration extends AbstractDataSourceConfiguration { private String dataSourceClassName; + private String username; private HikariDataSource pool; + private Properties hikari = new Properties(); @Bean(destroyMethod = "shutdown") diff --git a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index 36ac4a077d..7aa57663f5 100644 --- a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -597,7 +597,7 @@ decrement). Metrics for all HTTP requests are automatically recorded, so if you Here we can see basic `memory`, `heap`, `class loading`, `processor` and `thread pool` information along with some HTTP metrics. In this instance the `root` (``/'') and `/metrics` -URLs have returned `HTTP 200` responses `20` and `3` times respectively. It also appears +URLs have returned `HTTP 200` responses `20` and `3` times respectively. It also appears that the `root` URL returned `HTTP 401` (unauthorized) `4` times. The `gauge` shows the last response time for a request. So the last request to `root` took diff --git a/spring-boot-samples/spring-boot-sample-simple/src/test/java/sample/simple/SpringTestSampleSimpleApplicationTests.java b/spring-boot-samples/spring-boot-sample-simple/src/test/java/sample/simple/SpringTestSampleSimpleApplicationTests.java index 9b4c5cec0d..c99230992a 100644 --- a/spring-boot-samples/spring-boot-sample-simple/src/test/java/sample/simple/SpringTestSampleSimpleApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-simple/src/test/java/sample/simple/SpringTestSampleSimpleApplicationTests.java @@ -16,9 +16,6 @@ package sample.simple; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -26,6 +23,9 @@ import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Tests for {@link SampleSimpleApplication}. * @@ -40,9 +40,9 @@ public class SpringTestSampleSimpleApplicationTests { @Test public void testContextLoads() throws Exception { - assertNotNull(ctx); - assertTrue(ctx.containsBean("helloWorldService")); - assertTrue(ctx.containsBean("sampleSimpleApplication")); + assertNotNull(this.ctx); + assertTrue(this.ctx.containsBean("helloWorldService")); + assertTrue(this.ctx.containsBean("sampleSimpleApplication")); } } diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java index ed93d835e0..b4263a1462 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java @@ -101,19 +101,19 @@ public abstract class ExecutableArchiveLauncher extends Launcher { } private static ClassLoader getDefaultClassLoader() { - ClassLoader cl = null; + ClassLoader classloader = null; try { - cl = Thread.currentThread().getContextClassLoader(); + classloader = Thread.currentThread().getContextClassLoader(); } catch (Throwable ex) { // Cannot access thread context ClassLoader - falling back to system class // loader... } - if (cl == null) { + if (classloader == null) { // No thread context class loader -> use class loader of this class. - cl = ExecutableArchiveLauncher.class.getClassLoader(); + classloader = ExecutableArchiveLauncher.class.getClassLoader(); } - return cl; + return classloader; } } diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarURLConnection.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarURLConnection.java index 908d7bc511..2b956bb023 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarURLConnection.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarURLConnection.java @@ -27,7 +27,7 @@ import java.util.jar.Manifest; /** * {@link java.net.JarURLConnection} used to support {@link JarFile#getUrl()}. - * + * * @author Phillip Webb */ class JarURLConnection extends java.net.JarURLConnection { diff --git a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index d68bba5b1f..735eb0405f 100644 --- a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -459,7 +459,6 @@ public class SpringApplication { * content from the Environment (banner.location and banner.charset). The defaults are * banner.location=classpath:banner.txt, banner.charest=UTF-8. If the banner file does * not exist or cannot be printed, a simple default is created. - * * @see #setShowBanner(boolean) * @see #printBanner() */ @@ -476,9 +475,9 @@ public class SpringApplication { Charset.forName("UTF-8")))); return; } - catch (Exception e) { - System.out.println("Banner not printable: " + resource + " (" - + e.getClass() + ": '" + e.getMessage() + "')"); + catch (Exception ex) { + this.log.warn("Banner not printable: " + resource + " (" + ex.getClass() + + ": '" + ex.getMessage() + "')", ex); } } printBanner(); @@ -488,6 +487,7 @@ public class SpringApplication { * Print a simple banner message to the console. Subclasses can override this method * to provide additional or alternative banners. * @see #setShowBanner(boolean) + * @see #printBanner(Environment) */ protected void printBanner() { Banner.write(System.out);