From 3fe8b7c0df0d76a918ba1eae3953f5f14e453eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Cocula?= Date: Fri, 13 Jan 2017 21:41:55 +0100 Subject: [PATCH] Refactor application configuration load. --- .../java/org/libresonic/player/boot/Application.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java b/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java index fa8cfe93..aa1909e8 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java +++ b/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java @@ -145,16 +145,21 @@ public class Application extends SpringBootServletInitializer { return new ResponseHeaderFilter(); } - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + private static SpringApplicationBuilder doConfigure(SpringApplicationBuilder application) { // Customize the application or call application.sources(...) to add sources // Since our example is itself a @Configuration class (via @SpringBootApplication) // we actually don't need to override this method. return application.sources(Application.class).web(true).initializers(new AdditionalPropertySourceConfigurer()); } + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return doConfigure(application); + } + public static void main(String[] args) { - new SpringApplicationBuilder(Application.class).run(args); + SpringApplicationBuilder builder = new SpringApplicationBuilder(); + doConfigure(builder).run(args); } } \ No newline at end of file