From ac54d7fe3cbce1d25be8cb300d2941657a8a7604 Mon Sep 17 00:00:00 2001
From: Phillip Webb
* {@link EnableAutoConfiguration Auto-configuration} for metrics services. Creates
* user-facing {@link GaugeService} and {@link CounterService} instances, and also back
- * end repositories to catch the data pumped into them.
- *
* An {@link InMemoryMetricRepository} is always created unless another * {@link MetricRepository} is already provided by the user. In general, even if metric diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.java index 9b62efd36f..bb7ad5d1d0 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.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. @@ -21,7 +21,6 @@ import javax.validation.constraints.Pattern; /** * Abstract base for {@link Endpoint} implementations. - *
*
* @author Phillip Webb
* @author Christian Dupuis
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java
index ef687ec3b2..cf69bb6b56 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.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.
@@ -35,7 +35,6 @@ public class TraceEndpoint extends AbstractEndpoint
* This initializer is not intended to be shared across multiple application context
* instances.
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java
index 6c0faa4c45..da7785565f 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java
@@ -39,20 +39,17 @@ import org.springframework.core.io.support.SpringFactoriesLoader;
* have {@code tomat-embedded.jar} on your classpath you are likely to want a
* {@link TomcatEmbeddedServletContainerFactory} (unless you have defined your own
* {@link EmbeddedServletContainerFactory} bean).
- *
*
* Auto-configuration tries to be as intelligent as possible and will back-away as you
* define more of your own configuration. You can always manually {@link #exclude()} any
* configuration that you never want to apply. Auto-configuration is always applied after
* user-defined beans have been registered.
- *
*
* The package of the class that is annotated with {@code @EnableAutoConfiguration} has
* specific significance and is often used as a 'default'. For example, it will be used
* when scanning for {@code @Entity} classes. It is generally recommended that you place
* {@code @EnableAutoConfiguration} in a root package so that all sub-packages and classes
* can be searched.
- *
*
* Auto-configuration classes are regular Spring {@link Configuration} beans. They are
* located using the {@link SpringFactoriesLoader} mechanism (keyed against this class).
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java
index a1344f6b61..0fe2270477 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java
@@ -33,6 +33,8 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.PlatformTransactionManager;
/**
+ * Basic {@link BatchConfigurer} implementation.
+ *
* @author Dave Syer
*/
@Component
@@ -41,15 +43,28 @@ public class BasicBatchConfigurer implements BatchConfigurer {
private static Log logger = LogFactory.getLog(BasicBatchConfigurer.class);
private DataSource dataSource;
+
private EntityManagerFactory entityManagerFactory;
+
private PlatformTransactionManager transactionManager;
+
private JobRepository jobRepository;
+
private JobLauncher jobLauncher;
+ /**
+ * Create a new {@link BasicBatchConfigurer} instance.
+ * @param dataSource the underlying data source
+ */
public BasicBatchConfigurer(DataSource dataSource) {
this(dataSource, null);
}
+ /**
+ * Create a new {@link BasicBatchConfigurer} instance.
+ * @param dataSource the underlying data source
+ * @param entityManagerFactory the entity manager factory (or {@code null})
+ */
public BasicBatchConfigurer(DataSource dataSource,
EntityManagerFactory entityManagerFactory) {
this.entityManagerFactory = entityManagerFactory;
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDatabaseInitializer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDatabaseInitializer.java
index e145e90f5e..241359120c 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDatabaseInitializer.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDatabaseInitializer.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.
@@ -38,7 +38,8 @@ import org.springframework.stereotype.Component;
@Component
public class BatchDatabaseInitializer implements EnvironmentAware {
- private static final String DEFAULT_SCHEMA_LOCATION = "classpath:org/springframework/batch/core/schema-@@platform@@.sql";
+ private static final String DEFAULT_SCHEMA_LOCATION = "classpath:org/springframework/"
+ + "batch/core/schema-@@platform@@.sql";
@Autowired
private DataSource dataSource;
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java
index 759bd2eb85..419984c2a9 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.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.
@@ -198,16 +198,26 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
if (this.types.isEmpty() && this.names.isEmpty()) {
addDeducedBeanType(context, metadata, this.types);
}
- Assert.isTrue(
- !this.types.isEmpty() || !this.names.isEmpty()
- || !this.annotations.isEmpty(),
- "@"
- + ClassUtils.getShortName(annotationType)
- + " annotations must specify at least one bean (type, name or annotation)");
+ Assert.isTrue(hasAtLeastOne(this.types, this.names, this.annotations),
+ annotationName(annotationType) + " annotations must "
+ + "specify at least one bean (type, name or annotation)");
this.strategy = (SearchStrategy) metadata.getAnnotationAttributes(
annotationType.getName()).get("search");
}
+ private boolean hasAtLeastOne(List>... lists) {
+ for (List> list : lists) {
+ if (!list.isEmpty()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private String annotationName(Class> annotationType) {
+ return "@" + ClassUtils.getShortName(annotationType);
+ }
+
@SuppressWarnings({ "unchecked", "rawtypes" })
private void collect(MultiValueMap
* To disable auto export of annotation beans set
* Looks in various places for a properties file to extract loader settings, defaulting to
*
* A text may contain {@code $ ...} placeholders, to be resolved as system properties:
* e.g. {@code $ user.dir} . Default values can be supplied using the ":" separator
* between key and value.
- *
*
- *
* Adapted from Spring.
*
* @author Juergen Hoeller
@@ -40,13 +37,19 @@ import java.util.Set;
*/
public abstract class SystemPropertyUtils {
- /** Prefix for system property placeholders: "${" */
+ /**
+ * Prefix for system property placeholders: "${"
+ */
public static final String PLACEHOLDER_PREFIX = "${";
- /** Suffix for system property placeholders: "}" */
+ /**
+ * Suffix for system property placeholders: "}"
+ */
public static final String PLACEHOLDER_SUFFIX = "}";
- /** Value separator for system property placeholders: ":" */
+ /**
+ * Value separator for system property placeholders: ":"
+ */
public static final String VALUE_SEPARATOR = ":";
private static final String SIMPLE_PREFIX = PLACEHOLDER_PREFIX.substring(1);
@@ -166,7 +169,6 @@ public abstract class SystemPropertyUtils {
* Search the System properties and environment variables for a value with the
* provided key. Environment variables in > {
/**
* Create a new {@link TraceEndpoint} instance.
- *
* @param repository the trace repository
*/
public TraceEndpoint(TraceRepository repository) {
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java
index 4830f49a90..b197a8e7a0 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 the original author or authors.
+ * Copyright 2013-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.
@@ -184,8 +184,6 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
return builder.toString();
}
- // SmartLifeCycle implementation
-
@Override
public final int getPhase() {
return this.phase;
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointHandlerMapping.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointHandlerMapping.java
index ed98da9aa0..908b16c9eb 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointHandlerMapping.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointHandlerMapping.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.
@@ -46,7 +46,6 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
* @author Phillip Webb
* @author Christian Dupuis
* @author Dave Syer
- *
*/
public class EndpointHandlerMapping extends RequestMappingHandlerMapping implements
ApplicationContextAware {
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/GenericMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.java
similarity index 67%
rename from spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/GenericMvcEndpoint.java
rename to spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.java
index 524200cbb7..57bb44d503 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/GenericMvcEndpoint.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.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,18 +17,26 @@
package org.springframework.boot.actuate.endpoint.mvc;
import org.springframework.boot.actuate.endpoint.Endpoint;
+import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
+ * Adapter class to expose {@link Endpoint}s as {@link MvcEndpoint}s.
+ *
* @author Dave Syer
*/
-public class GenericMvcEndpoint implements MvcEndpoint {
+public class EndpointMvcAdapter implements MvcEndpoint {
- private Endpoint> delegate;
+ private final Endpoint> delegate;
- public GenericMvcEndpoint(Endpoint> delegate) {
+ /**
+ * Create a new {@link EndpointMvcAdapter}.
+ * @param delegate the underlying {@link Endpoint} to adapt.
+ */
+ public EndpointMvcAdapter(Endpoint> delegate) {
+ Assert.notNull(delegate, "Delegate must not be null");
this.delegate = delegate;
}
@@ -49,11 +57,9 @@ public class GenericMvcEndpoint implements MvcEndpoint {
}
@Override
- public Class> getEndpointType() {
- @SuppressWarnings("unchecked")
- Class extends Endpoint>> type = (Class extends Endpoint>>) this.delegate
- .getClass();
- return type;
+ @SuppressWarnings("rawtypes")
+ public Class extends Endpoint> getEndpointType() {
+ return this.delegate.getClass();
}
}
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java
index 1eacc19b75..f8a741a003 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.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.
@@ -27,9 +27,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
/**
+ * Adapter to expose {@link EnvironmentEndpoint} as an {@link MvcEndpoint}.
+ *
* @author Dave Syer
*/
-public class EnvironmentMvcEndpoint extends GenericMvcEndpoint implements
+public class EnvironmentMvcEndpoint extends EndpointMvcAdapter implements
EnvironmentAware {
private Environment environment;
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java
index 7c7ea90d24..8f4d03edeb 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 the original author or authors.
+ * Copyright 2013-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.
@@ -38,8 +38,7 @@ import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.ServletWrappingController;
/**
- * {@link Endpoint} implementation to register the Jolokia infrastructure with the Boot
- * management subsystem.
+ * {@link MvcEndpoint} to expose Jolokia.
*
* @author Christian Dupuis
*/
@@ -110,7 +109,8 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
}
@Override
- public Class> getEndpointType() {
+ @SuppressWarnings("rawtypes")
+ public Class extends Endpoint> getEndpointType() {
return null;
}
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java
index 5b9e120f9c..f54eb450d7 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.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.
@@ -18,17 +18,19 @@ package org.springframework.boot.actuate.endpoint.mvc;
import java.util.Map;
+import org.springframework.boot.actuate.endpoint.Endpoint;
import org.springframework.boot.actuate.web.ErrorController;
import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
/**
- * Special endpoint for handling "/error" path when the management servlet is in a child
- * context. The regular {@link ErrorController} should be available there but because of
- * the way the handler mappings are set up it will not be detected.
+ * Special {@link MvcEndpoint} for handling "/error" path when the management servlet is
+ * in a child context. The regular {@link ErrorController} should be available there but
+ * because of the way the handler mappings are set up it will not be detected.
*
* @author Dave Syer
*/
@@ -36,9 +38,11 @@ import org.springframework.web.context.request.RequestContextHolder;
public class ManagementErrorEndpoint implements MvcEndpoint {
private final ErrorController controller;
- private String path;
+
+ private final String path;
public ManagementErrorEndpoint(String path, ErrorController controller) {
+ Assert.notNull(controller, "Controller must not be null");
this.path = path;
this.controller = controller;
}
@@ -61,7 +65,8 @@ public class ManagementErrorEndpoint implements MvcEndpoint {
}
@Override
- public Class> getEndpointType() {
+ @SuppressWarnings("rawtypes")
+ public Class extends Endpoint> getEndpointType() {
return null;
}
-}
\ No newline at end of file
+}
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MetricsMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MetricsMvcEndpoint.java
index 26800b5b89..920d0adfc4 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MetricsMvcEndpoint.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MetricsMvcEndpoint.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.
@@ -25,11 +25,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
/**
+ * Adapter to expose {@link MetricsEndpoint} as an {@link MvcEndpoint}.
+ *
* @author Dave Syer
*/
-public class MetricsMvcEndpoint extends GenericMvcEndpoint {
+public class MetricsMvcEndpoint extends EndpointMvcAdapter {
- private MetricsEndpoint delegate;
+ private final MetricsEndpoint delegate;
public MetricsMvcEndpoint(MetricsEndpoint delegate) {
super(delegate);
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoint.java
index 7aa76420f7..a6ad2893ab 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoint.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoint.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.
@@ -29,10 +29,22 @@ import org.springframework.boot.actuate.endpoint.Endpoint;
*/
public interface MvcEndpoint {
+ /**
+ * Return the MVC path of the endpoint.
+ */
String getPath();
+ /**
+ * Return if the endpoint exposes sensitive information.
+ */
boolean isSensitive();
- Class> getEndpointType();
+ /**
+ * Return the type of {@link Endpoint} exposed, or {@code null} if this
+ * {@link MvcEndpoint} exposes information that cannot be represented as a traditional
+ * {@link Endpoint}.
+ */
+ @SuppressWarnings("rawtypes")
+ Class extends Endpoint> getEndpointType();
-}
\ No newline at end of file
+}
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoints.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoints.java
index 3e1801b45c..5b7e329614 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoints.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoints.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.
@@ -60,7 +60,7 @@ public class MvcEndpoints implements ApplicationContextAware, InitializingBean {
Endpoint.class).values();
for (Endpoint> endpoint : delegates) {
if (isGenericEndpoint(endpoint.getClass())) {
- this.endpoints.add(new GenericMvcEndpoint(endpoint));
+ this.endpoints.add(new EndpointMvcAdapter(endpoint));
}
}
}
@@ -85,4 +85,4 @@ public class MvcEndpoints implements ApplicationContextAware, InitializingBean {
&& !MvcEndpoint.class.isAssignableFrom(type);
}
-}
\ No newline at end of file
+}
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.java
index 0877ed6885..dfa6865200 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.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.
@@ -22,9 +22,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
+ * Adapter to expose {@link ShutdownEndpoint} as an {@link MvcEndpoint}.
+ *
* @author Dave Syer
*/
-public class ShutdownMvcEndpoint extends GenericMvcEndpoint {
+public class ShutdownMvcEndpoint extends EndpointMvcAdapter {
public ShutdownMvcEndpoint(ShutdownEndpoint delegate) {
super(delegate);
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/VanillaHealthIndicator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/VanillaHealthIndicator.java
index f98f91ee17..fa07500c82 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/VanillaHealthIndicator.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/VanillaHealthIndicator.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.actuate.health;
/**
- * Default implementation of {@link HealthIndicator} that simply returns "ok".
+ * Default implementation of {@link HealthIndicator} that simply returns {@literal "ok"}.
*
* @author Dave Syer
*/
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/AbstractMetricExporter.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/AbstractMetricExporter.java
index 42a454c365..c78eb92cd3 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/AbstractMetricExporter.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/AbstractMetricExporter.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.
@@ -49,7 +49,6 @@ public abstract class AbstractMetricExporter implements Exporter {
/**
* The earliest time for which data will be exported.
- *
* @param earliestTimestamp the timestamp to set
*/
public void setEarliestTimestamp(Date earliestTimestamp) {
@@ -58,7 +57,6 @@ public abstract class AbstractMetricExporter implements Exporter {
/**
* Ignore timestamps (export all metrics).
- *
* @param ignoreTimestamps the flag to set
*/
public void setIgnoreTimestamps(boolean ignoreTimestamps) {
@@ -96,7 +94,6 @@ public abstract class AbstractMetricExporter implements Exporter {
* prefixes). If the metrics to be exported partition into groups identified by a
* String, subclasses should override this method. Otherwise the default should be
* fine (iteration over all metrics).
- *
* @return groups of metrics to iterate over (default singleton empty string)
*/
protected Iterable
*
spring.jmx.enabled: false
.
*
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java
index 57448776e2..6baf2dbec3 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.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.
@@ -48,7 +48,6 @@ public class ReactorAutoConfiguration {
@ConditionalOnMissingBean(Environment.class)
@EnableReactor
protected static class ReactorConfiguration {
-
}
}
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.java
index 340abb9cfb..a8a5f0e849 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.java
@@ -33,6 +33,11 @@ import org.springframework.security.config.annotation.ObjectPostProcessor;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.authentication.configurers.provisioning.InMemoryUserDetailsManagerConfigurer;
+/**
+ * Configuration for a Spring Security in-memory {@link AuthenticationManager}.
+ *
+ * @author Dave Syer
+ */
@Configuration
@ConditionalOnBean(ObjectPostProcessor.class)
@ConditionalOnMissingBean(AuthenticationManager.class)
@@ -69,4 +74,4 @@ public class AuthenticationManagerConfiguration {
}
-}
\ No newline at end of file
+}
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfiguration.java
index 95fdb9b5cd..8feb7c4318 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfiguration.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfiguration.java
@@ -16,6 +16,7 @@
package org.springframework.boot.autoconfigure.security;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -24,6 +25,11 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.security.authentication.AuthenticationManager;
+/**
+ * {@link EnableAutoConfiguration Auto-configuration} for Spring Security.
+ *
+ * @author Dave Syer
+ */
@Configuration
@ConditionalOnClass(AuthenticationManager.class)
@EnableConfigurationProperties
@@ -37,4 +43,4 @@ public class SecurityAutoConfiguration {
return new SecurityProperties();
}
-}
\ No newline at end of file
+}
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java
index 8a0fbf46f5..591b72f160 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java
@@ -87,7 +87,6 @@ import org.springframework.web.servlet.support.RequestDataValueProcessor;
@ConditionalOnClass({ EnableWebSecurity.class })
@ConditionalOnMissingBean(WebSecurityConfiguration.class)
@ConditionalOnWebApplication
-// @ConditionalOnMissingBean(annotation = EnableWebSecurity.class)
public class SpringBootWebSecurityConfiguration {
private static List
+ *
*
* @author Phillip Webb
* @author Dave Syer
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/RepositoryConfigurationFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/RepositoryConfigurationFactory.java
index e015ee1a72..8ba6d19f86 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/RepositoryConfigurationFactory.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/RepositoryConfigurationFactory.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.
@@ -61,7 +61,6 @@ public final class RepositoryConfigurationFactory {
/**
* Add the default local M2 cache directory as a remote repository. Only do this if
* the local cache location has been changed from the default.
- *
* @param repositoryConfiguration
*/
public static void addDefaultCacheAsRespository(
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/JreProxySelector.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/JreProxySelector.java
index 815336972a..7db52c4a4e 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/JreProxySelector.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/JreProxySelector.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.
@@ -54,7 +54,7 @@ public final class JreProxySelector implements ProxySelector {
URI uri = new URI(repository.getUrl()).parseServerAuthority();
proxies = java.net.ProxySelector.getDefault().select(uri);
}
- catch (Exception e) {
+ catch (Exception ex) {
// URL invalid or not accepted by selector or no selector at all, simply use
// no proxy
}
@@ -113,7 +113,7 @@ public final class JreProxySelector implements ProxySelector {
try {
url = new URL(context.getRepository().getUrl());
}
- catch (Exception e) {
+ catch (Exception ex) {
url = null;
}
@@ -133,7 +133,7 @@ public final class JreProxySelector implements ProxySelector {
System.getProperty("http.proxyPassword"));
}
}
- catch (SecurityException e) {
+ catch (SecurityException ex) {
// oh well, let's hope the proxy can do without auth
}
}
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/ManagedDependenciesFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/ManagedDependenciesFactory.java
index ae1482318b..8d683db0d2 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/ManagedDependenciesFactory.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/ManagedDependenciesFactory.java
@@ -28,5 +28,9 @@ import org.eclipse.aether.graph.Dependency;
*/
public interface ManagedDependenciesFactory {
+ /**
+ * Returns the managed dependencies.
+ */
Listbeans{}
closure from inside this block if
* there is one. Removes it from the block at the same time.
- *
* @param block a block statement (class definition)
* @return a beans Closure if one can be found, null otherwise
*/
@@ -128,9 +127,7 @@ public class GroovyBeansTransformation implements ASTTransformation {
}
}
}
-
return null;
-
}
}
}
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableDeviceResolver.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableDeviceResolver.java
index e8c3075843..7d0d2c04be 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableDeviceResolver.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableDeviceResolver.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.
@@ -22,9 +22,14 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import org.springframework.boot.cli.compiler.autoconfigure.SpringMobileCompilerAutoConfiguration;
+
+/**
+ * Pseudo annotation used to trigger {@link SpringMobileCompilerAutoConfiguration}.
+ */
@Target(ElementType.TYPE)
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface EnableDeviceResolver {
-}
\ No newline at end of file
+}
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableIntegrationPatterns.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableIntegrationPatterns.java
index d4be1ee03c..87d913a5f9 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableIntegrationPatterns.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableIntegrationPatterns.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.
@@ -22,9 +22,13 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import org.springframework.boot.cli.compiler.autoconfigure.SpringIntegrationCompilerAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
+/**
+ * Pseudo annotation used to trigger {@link SpringIntegrationCompilerAutoConfiguration}.
+ */
@Target(ElementType.TYPE)
@Documented
@Retention(RetentionPolicy.RUNTIME)
@@ -32,4 +36,4 @@ import org.springframework.context.annotation.ImportResource;
@ImportResource("classpath:/org/springframework/boot/groovy/integration.xml")
public @interface EnableIntegrationPatterns {
-}
\ No newline at end of file
+}
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableJmsMessaging.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableJmsMessaging.java
index 0a40997b81..3ea3ed31b2 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableJmsMessaging.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/EnableJmsMessaging.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.
@@ -22,9 +22,14 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import org.springframework.boot.cli.compiler.autoconfigure.JmsCompilerAutoConfiguration;
+
+/**
+ * Pseudo annotation used to trigger {@link JmsCompilerAutoConfiguration}.
+ */
@Target(ElementType.TYPE)
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface EnableJmsMessaging {
-}
\ No newline at end of file
+}
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java
index b9d7fd3bf2..984c7fb3a2 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.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.
@@ -28,6 +28,8 @@ import java.util.Map;
import org.codehaus.groovy.control.CompilationFailedException;
/**
+ * Helpful utilties for working with Groovy {@link Template}s.
+ *
* @author Dave Syer
*/
public abstract class GroovyTemplate {
diff --git a/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java
index 2639b3134d..421507e4f3 100644
--- a/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java
+++ b/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java
@@ -50,9 +50,9 @@ public class SampleMongoApplicationTests {
output.contains("firstName='Alice', lastName='Smith'"));
}
- private boolean serverNotRunning(IllegalStateException e) {
+ private boolean serverNotRunning(IllegalStateException ex) {
@SuppressWarnings("serial")
- NestedCheckedException nested = new NestedCheckedException("failed", e) {
+ NestedCheckedException nested = new NestedCheckedException("failed", ex) {
};
if (nested.contains(IOException.class)) {
Throwable root = nested.getRootCause();
diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPluginExtension.groovy b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPluginExtension.groovy
index 20b05fe2f8..938edcb663 100644
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPluginExtension.groovy
+++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPluginExtension.groovy
@@ -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.
@@ -19,11 +19,12 @@ package org.springframework.boot.gradle
import org.springframework.boot.loader.tools.Layout
import org.springframework.boot.loader.tools.Layouts
+
/**
* Gradle DSL Extension for 'Spring Boot'. Most of the time Spring Boot can guess the
* settings in this extension, but occasionally you might need to explicitly set one
* or two of them. E.g.
- *
+ *
*
* apply plugin: "spring-boot"
* springBoot {
@@ -53,7 +54,7 @@ public class SpringBootPluginExtension {
String mainClass
/**
- * The name of the ivy configuration name to treat as 'provided' (when packaging
+ * The name of the ivy configuration name to treat as 'provided' (when packaging
* those dependencies in a separate path). If not specified 'providedRuntime' will
* be used.
*/
@@ -73,15 +74,14 @@ public class SpringBootPluginExtension {
* The layout of the archive if it can't be derived from the file extension.
* Valid values are JAR, WAR, ZIP, DIR (for exploded zip file). ZIP and DIR
* are actually synonymous, and should be used if there is no MANIFEST.MF
- * available, or if you want the MANIFEST.MF 'Main-Class' to be
- * PropertiesLauncher. Gradle will coerce literal String values to the
+ * available, or if you want the MANIFEST.MF 'Main-Class' to be
+ * PropertiesLauncher. Gradle will coerce literal String values to the
* correct type.
*/
LayoutType layout;
/**
* Convenience method for use in a custom task.
- *
* @return the Layout to use or null if not explicitly set
*/
Layout convertLayout() {
diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java
index 8cb90bd50d..a70e27fa45 100644
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java
+++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java
@@ -1,3 +1,18 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.boot.gradle.task;
@@ -13,7 +28,7 @@ import org.springframework.boot.loader.tools.LibraryScope;
/**
* Expose Gradle {@link Configuration}s as {@link Libraries}.
- *
+ *
* @author Phillip Webb
*/
class ProjectLibraries implements Libraries {
@@ -26,7 +41,6 @@ class ProjectLibraries implements Libraries {
/**
* Create a new {@link ProjectLibraries} instance of the specified {@link Project}.
- *
* @param project the gradle project
*/
public ProjectLibraries(Project project) {
@@ -35,7 +49,6 @@ class ProjectLibraries implements Libraries {
/**
* Set the name of the provided configuration. Defaults to 'providedRuntime'.
- *
* @param providedConfigurationName the providedConfigurationName to set
*/
public void setProvidedConfigurationName(String providedConfigurationName) {
diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java
index ad85bd0a65..1493afa800 100644
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java
+++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java
@@ -95,8 +95,8 @@ public class RunApp extends DefaultTask {
getLogger().info("Looking for main in: " + main.getOutput().getClassesDir());
try {
return MainClassFinder.findMainClass(main.getOutput().getClassesDir());
- } catch (IOException e) {
- throw new IllegalStateException("Cannot find main class", e);
+ } catch (IOException ex) {
+ throw new IllegalStateException("Cannot find main class", ex);
}
}
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 d64b4ca840..dfff61afae 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
@@ -51,7 +51,6 @@ import org.springframework.boot.loader.util.SystemPropertyUtils;
* {@link Launcher} for archives with user-configured classpath and main class via a
* properties file. This model is often more flexible and more amenable to creating
* well-behaved OS-level services than a model based on executable jars.
- *
*
application.properties
either on the current classpath or in the current
@@ -62,7 +61,6 @@ import org.springframework.boot.loader.util.SystemPropertyUtils;
* file:
or any valid URL). Once that file is located turns it into
* Properties and extracts optional values (which can also be provided overridden as
* System properties in case the file doesn't exist):
- *
*
*
loader.path
: a comma-separated list of directories to append to the
* classpath (containing file resources and/or nested archives in *.jar or *.zip).
@@ -345,7 +343,7 @@ public class PropertiesLauncher extends Launcher {
try {
return loaderClass.getConstructor(ClassLoader.class).newInstance(parent);
}
- catch (NoSuchMethodException e) {
+ catch (NoSuchMethodException ex) {
// Ignore and try with URLs
}
diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/FilteredArchive.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/FilteredArchive.java
index f670408e02..4ed025a9b4 100644
--- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/FilteredArchive.java
+++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/FilteredArchive.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.
@@ -28,11 +28,14 @@ import java.util.jar.Manifest;
import org.springframework.boot.loader.AsciiBytes;
/**
+ * Decorator to apply an {@link Archive.EntryFilter} to an existing {@link Archive}.
+ *
* @author Dave Syer
*/
public class FilteredArchive extends Archive {
private Archive parent;
+
private EntryFilter filter;
public FilteredArchive(Archive parent, EntryFilter filter) {
diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java
index df626a7227..94ba0e6860 100644
--- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java
+++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.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.
@@ -22,14 +22,11 @@ import java.util.Set;
/**
* Helper class for resolving placeholders in texts. Usually applied to file paths.
- *
* UPPER_CASE
style are allowed
* where System properties would normally be lower.case
.
- *
* @param key the key to resolve
* @param text optional extra context for an error message if the key resolution fails
* (e.g. if System properties are not accessible)
diff --git a/spring-boot/src/main/java/org/springframework/boot/config/SimpleJsonParser.java b/spring-boot/src/main/java/org/springframework/boot/config/SimpleJsonParser.java
index d89da21473..f9b79d9086 100644
--- a/spring-boot/src/main/java/org/springframework/boot/config/SimpleJsonParser.java
+++ b/spring-boot/src/main/java/org/springframework/boot/config/SimpleJsonParser.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.
@@ -88,14 +88,14 @@ public class SimpleJsonParser implements JsonParser {
try {
return Long.valueOf(json);
}
- catch (NumberFormatException e) {
+ catch (NumberFormatException ex) {
// ignore
}
try {
return Double.valueOf(json);
}
- catch (NumberFormatException e) {
+ catch (NumberFormatException ex) {
// ignore
}
diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainer.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainer.java
index bd4e92e8a2..755b1a229b 100644
--- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainer.java
+++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainer.java
@@ -109,8 +109,8 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer {
ReflectionUtils.findMethod(connector.getClass(), "getLocalPort"),
connector)).toString();
}
- catch (Exception e) {
- return "could not determine port ( " + e.getMessage() + ")";
+ catch (Exception ex) {
+ return "could not determine port ( " + ex.getMessage() + ")";
}
}
diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java
index 13c8e54b30..f87ab96918 100644
--- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java
+++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java
@@ -1,7 +1,5 @@
-package org.springframework.boot.context.embedded.tomcat;
-
/*
- * 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.
@@ -16,6 +14,8 @@ package org.springframework.boot.context.embedded.tomcat;
* limitations under the License.
*/
+package org.springframework.boot.context.embedded.tomcat;
+
import org.apache.catalina.loader.WebappClassLoader;
/**
diff --git a/spring-boot/src/main/java/org/springframework/boot/test/package-info.java b/spring-boot/src/main/java/org/springframework/boot/test/package-info.java
new file mode 100644
index 0000000000..6f376b0119
--- /dev/null
+++ b/spring-boot/src/main/java/org/springframework/boot/test/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Classes and utilities that are useful when unit-testing Spring Boot applications.
+ * This package is only intended for use in 'src/test' and should not be used in your
+ * 'src/main' code.
+ */
+package org.springframework.boot.test;
+
diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java
index 7e8220057b..e4ada88e9e 100644
--- a/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java
+++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java
@@ -394,12 +394,14 @@ public class EnableConfigurationPropertiesTests {
@Configuration
protected static class DefaultConfiguration {
+
@Bean
public TestProperties testProperties() {
TestProperties test = new TestProperties();
test.setName("bar");
return test;
}
+
}
@Configuration
@@ -410,10 +412,12 @@ public class EnableConfigurationPropertiesTests {
@EnableConfigurationProperties
@Configuration
public static class ExampleConfig {
+
@Bean
public External external() {
return new External();
}
+
}
@EnableConfigurationProperties(External.class)
@@ -461,6 +465,7 @@ public class EnableConfigurationPropertiesTests {
@ConfigurationProperties(name = "spring_test_external")
public static class SystemEnvVar {
+
public String getVal() {
return this.val;
}
@@ -475,6 +480,7 @@ public class EnableConfigurationPropertiesTests {
@Component
protected static class TestConsumer {
+
@Autowired
private TestProperties properties;
@@ -495,7 +501,9 @@ public class EnableConfigurationPropertiesTests {
@ConfigurationProperties
protected static class NestedProperties {
+
private String name;
+
private Nested nested = new Nested();
public void setName(String name) {
@@ -507,6 +515,7 @@ public class EnableConfigurationPropertiesTests {
}
protected static class Nested {
+
private String name;
public void setName(String name) {
@@ -514,15 +523,18 @@ public class EnableConfigurationPropertiesTests {
}
}
+
}
@ConfigurationProperties
protected static class BaseProperties {
+
private String name;
public void setName(String name) {
this.name = name;
}
+
}
protected static class DerivedProperties extends BaseProperties {
@@ -530,8 +542,11 @@ public class EnableConfigurationPropertiesTests {
@ConfigurationProperties
protected static class TestProperties {
+
private String name;
+
private int[] array;
+
private List