diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfiguration.java index 890384ec4f..d4c33b6d12 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfiguration.java @@ -44,8 +44,9 @@ import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver; /** * {@link EnableAutoConfiguration Auto-configuration} for FreeMarker. - * + * * @author Andy Wilkinson + * @since 1.1.0 */ @Configuration @ConditionalOnClass(freemarker.template.Configuration.class) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java index 9bdf78c768..fea29e6ceb 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java @@ -22,11 +22,11 @@ import org.springframework.core.io.ResourceLoader; import org.springframework.util.ClassUtils; /** - * {@link TemplateAvailabilityProvider} that provides availability information - * for FreeMarker view templates - * + * {@link TemplateAvailabilityProvider} that provides availability information for + * FreeMarker view templates + * * @author Andy Wilkinson - * + * @since 1.1.0 */ public class FreeMarkerTemplateAvailabilityProvider implements TemplateAvailabilityProvider { @@ -34,15 +34,16 @@ public class FreeMarkerTemplateAvailabilityProvider implements @Override public boolean isTemplateAvailable(String view, Environment environment, ClassLoader classLoader, ResourceLoader resourceLoader) { - if (ClassUtils.isPresent("freemarker.template.Configuration", - classLoader)) { - String loaderPath = environment.getProperty("spring.freemarker.templateLoaderPath", + if (ClassUtils.isPresent("freemarker.template.Configuration", classLoader)) { + String loaderPath = environment.getProperty( + "spring.freemarker.templateLoaderPath", FreeMarkerAutoConfiguration.DEFAULT_TEMPLATE_LOADER_PATH); String prefix = environment.getProperty("spring.freemarker.prefix", FreeMarkerAutoConfiguration.DEFAULT_PREFIX); String suffix = environment.getProperty("spring.freemarker.suffix", FreeMarkerAutoConfiguration.DEFAULT_SUFFIX); - return resourceLoader.getResource(loaderPath + prefix + view + suffix).exists(); + return resourceLoader.getResource(loaderPath + prefix + view + suffix) + .exists(); } return false; } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProvider.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProvider.java index 9d53909395..37f4760b5b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProvider.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProvider.java @@ -24,9 +24,9 @@ import org.springframework.util.ClassUtils; /** * {@link TemplateAvailabilityProvider} that provides availability information for * Thymeleaf view templates - * + * * @author Andy Wilkinson - * + * @since 1.1.0 */ public class ThymeleafTemplateAvailabilityProvider implements TemplateAvailabilityProvider { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration.java index 85a1d2668f..6f91d5d1cd 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration.java @@ -58,7 +58,7 @@ import org.springframework.web.servlet.view.BeanNameViewResolver; /** * {@link EnableAutoConfiguration Auto-configuration} to render errors via a MVC error * controller. - * + * * @author Dave Syer * @author Andy Wilkinson */ diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JspTemplateAvailabilityProvider.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JspTemplateAvailabilityProvider.java index e53b08a1fc..d4b3a887e6 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JspTemplateAvailabilityProvider.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JspTemplateAvailabilityProvider.java @@ -21,6 +21,13 @@ import org.springframework.core.env.Environment; import org.springframework.core.io.ResourceLoader; import org.springframework.util.ClassUtils; +/** + * {@link TemplateAvailabilityProvider} that provides availability information for JSP + * view templates + * + * @author Andy Wilkinson + * @since 1.1.0 + */ public class JspTemplateAvailabilityProvider implements TemplateAvailabilityProvider { @Override diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationTests.java index 7f37a2d295..976ef5177c 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationTests.java @@ -41,7 +41,7 @@ import static org.junit.Assert.assertTrue; /** * Tests for {@link FreeMarkerAutoConfiguration}. - * + * * @author Andy Wilkinson */ public class FreeMarkerAutoConfigurationTests { @@ -85,8 +85,8 @@ public class FreeMarkerAutoConfigurationTests { new File("target/test-classes/templates/empty-directory").mkdir(); EnvironmentTestUtils - .addEnvironment(this.context, - "spring.freemarker.templateLoaderPath:classpath:/templates/empty-directory/"); + .addEnvironment(this.context, + "spring.freemarker.templateLoaderPath:classpath:/templates/empty-directory/"); this.context.register(FreeMarkerAutoConfiguration.class); this.context.refresh(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProviderTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProviderTests.java index 3a02e833fb..ea4f2ef3e1 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProviderTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProviderTests.java @@ -27,7 +27,7 @@ import static org.junit.Assert.assertTrue; /** * Tests for {@link FreeMarkerTemplateAvailabilityProvider}. - * + * * @author Andy Wilkinson */ public class FreeMarkerTemplateAvailabilityProviderTests { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProviderTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProviderTests.java index 717a04473b..6f4bdf544c 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProviderTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafTemplateAvailabilityProviderTests.java @@ -27,7 +27,7 @@ import static org.junit.Assert.assertTrue; /** * Tests for {@link ThymeleafTemplateAvailabilityProvider}. - * + * * @author Andy Wilkinson */ public class ThymeleafTemplateAvailabilityProviderTests { diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/SampleController.java b/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/SampleController.java index 8fd31cee43..0204645008 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/SampleController.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/SampleController.java @@ -37,18 +37,18 @@ public class SampleController { @Autowired private HelloWorldService helloWorldService; - @RequestMapping(value="/", method=RequestMethod.GET) + @RequestMapping(value = "/", method = RequestMethod.GET) @ResponseBody public Map hello() { return Collections.singletonMap("message", this.helloWorldService.getHelloMessage()); } - @RequestMapping(value="/", method=RequestMethod.POST) + @RequestMapping(value = "/", method = RequestMethod.POST) @ResponseBody public Map olleh(@Validated Message message) { Map model = new LinkedHashMap(); - model .put("message", message.getValue()); + model.put("message", message.getValue()); model.put("title", "Hello Home"); model.put("date", new Date()); return model; @@ -59,14 +59,14 @@ public class SampleController { public String foo() { throw new IllegalArgumentException("Server error"); } - + protected static class Message { - - @NotBlank(message="Message value cannot be empty") + + @NotBlank(message = "Message value cannot be empty") private String value; public String getValue() { - return value; + return this.value; } public void setValue(String value) { @@ -74,5 +74,4 @@ public class SampleController { } } - } diff --git a/spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java b/spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java index 0ee2f08cb5..e5e731712d 100644 --- a/spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java +++ b/spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java @@ -28,9 +28,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; * The GemstoneAppConfiguration class for allowing Spring Boot to pickup additional * application Spring configuration meta-data for GemFire, which must be specified in * Spring Data GemFire's XML namespace. - *

+ * * @author John Blum - * @since 1.1.0 */ @Configuration @ImportResource("/spring-data-gemfire-cache.xml") diff --git a/spring-boot/src/main/java/org/springframework/boot/web/TemplateAvailabilityProvider.java b/spring-boot/src/main/java/org/springframework/boot/web/TemplateAvailabilityProvider.java index c9eea3d7da..8acd42e0b3 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/TemplateAvailabilityProvider.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/TemplateAvailabilityProvider.java @@ -20,17 +20,20 @@ import org.springframework.core.env.Environment; import org.springframework.core.io.ResourceLoader; /** - * A {@code TemplateAvailabilityProvider} indicates the availability of view templates for - * a particular templating engine such as FreeMarker or Thymeleaf - * + * Indicates the availability of view templates for a particular templating engine such as + * FreeMarker or Thymeleaf + * * @author Andy Wilkinson - * + * @since 1.1.0 */ public interface TemplateAvailabilityProvider { /** - * Returns {@code true} if a template is available for the given {@code view}, - * otherwise {@code false} is returned. + * Returns {@code true} if a template is available for the given {@code view}. + * @param view the view name + * @param environment the environment + * @param classLoader the class loader + * @param resourceLoader the resource loader */ boolean isTemplateAvailable(String view, Environment environment, ClassLoader classLoader, ResourceLoader resourceLoader);