diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java index 728b674910..9bf48b90d0 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java @@ -160,7 +160,7 @@ public class MessageSourceAutoConfiguration { classLoader = classLoader.getParent(); } } - catch (Throwable e) { + catch (Throwable ex) { } ROOT_CLASSLOADER = classLoader; } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/app/SpringApplicationLauncher.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/app/SpringApplicationLauncher.java index 44fec71cad..10ec0cbbd1 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/app/SpringApplicationLauncher.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/app/SpringApplicationLauncher.java @@ -16,6 +16,7 @@ package org.springframework.boot.cli.app; +import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; @@ -36,7 +37,6 @@ public class SpringApplicationLauncher { /** * Creates a new launcher that will use the given {@code classLoader} to load * {@code SpringApplication}. - * * @param classLoader the {@code ClassLoader} to use */ public SpringApplicationLauncher(ClassLoader classLoader) { @@ -46,7 +46,6 @@ public class SpringApplicationLauncher { /** * Launches the application created using the given {@code sources}. The application * is launched with the given {@code args}. - * * @param sources The sources for the application * @param args The args for the application * @return The application's {@code ApplicationContext} @@ -55,10 +54,9 @@ public class SpringApplicationLauncher { public Object launch(Object[] sources, String[] args) throws Exception { Map defaultProperties = new HashMap(); defaultProperties.put("spring.groovy.template.check-template-location", "false"); - Class applicationClass = this.classLoader.loadClass(SPRING_APPLICATION_CLASS); - Object application = applicationClass.getConstructor(Object[].class).newInstance( - (Object) sources); + Constructor constructor = applicationClass.getConstructor(Object[].class); + Object application = constructor.newInstance((Object) sources); applicationClass.getMethod("setDefaultProperties", Map.class).invoke(application, defaultProperties); Method method = applicationClass.getMethod("run", String[].class); diff --git a/spring-boot/src/main/java/org/springframework/boot/json/GsonJsonParser.java b/spring-boot/src/main/java/org/springframework/boot/json/GsonJsonParser.java index f19c0d44a1..4132d7a36f 100644 --- a/spring-boot/src/main/java/org/springframework/boot/json/GsonJsonParser.java +++ b/spring-boot/src/main/java/org/springframework/boot/json/GsonJsonParser.java @@ -23,7 +23,11 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; /** - * @author dsyer + * Thin wrapper to adapt {@link Gson} to a {@link JsonParser}. + * + * @author Dave Syer + * @since 1.2.0 + * @see JsonParserFactory */ public class GsonJsonParser implements JsonParser { diff --git a/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java b/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java index 8b47bf7f43..2f2fd622df 100644 --- a/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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/src/test/java/org/springframework/boot/json/GsonJsonParserTests.java b/spring-boot/src/test/java/org/springframework/boot/json/GsonJsonParserTests.java index ae0a108da1..89a51e728a 100644 --- a/spring-boot/src/test/java/org/springframework/boot/json/GsonJsonParserTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/json/GsonJsonParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -17,7 +17,7 @@ package org.springframework.boot.json; /** - * Tests for {@link YamlJsonParser}. + * Tests for {@link GsonJsonParser}. * * @author Dave Syer */