diff --git a/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java b/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java index 989e1ca117..f0abef730d 100644 --- a/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java +++ b/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java @@ -149,7 +149,6 @@ class BeanDefinitionLoader { } private int load(Package source) { - // FIXME register the scanned package for data to pick up return this.scanner.scan(source.getName()); } diff --git a/spring-boot/src/main/java/org/springframework/boot/bind/CustomPropertyConstructor.java b/spring-boot/src/main/java/org/springframework/boot/bind/CustomPropertyConstructor.java index 98ce94ff3e..b1a9ec338f 100644 --- a/spring-boot/src/main/java/org/springframework/boot/bind/CustomPropertyConstructor.java +++ b/spring-boot/src/main/java/org/springframework/boot/bind/CustomPropertyConstructor.java @@ -85,18 +85,10 @@ public class CustomPropertyConstructor extends Constructor { @Override protected Property getProperty(Class type, String name) throws IntrospectionException { - Property p = lookupProperty(type, name); - - return p != null ? p : super.getProperty(type, name); - } - - private Property lookupProperty(Class type, String name) { - Map m = CustomPropertyConstructor.this.properties.get(type); - - if (m != null) { - return m.get(name); - } - return null; + Map forType = CustomPropertyConstructor.this.properties + .get(type); + Property property = (forType == null ? null : forType.get(name)); + return (property == null ? super.getProperty(type, name) : property); } } } diff --git a/spring-boot/src/main/java/org/springframework/boot/bind/PropertiesConfigurationFactory.java b/spring-boot/src/main/java/org/springframework/boot/bind/PropertiesConfigurationFactory.java index 806e580eae..fef84878b9 100644 --- a/spring-boot/src/main/java/org/springframework/boot/bind/PropertiesConfigurationFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/bind/PropertiesConfigurationFactory.java @@ -82,7 +82,6 @@ public class PropertiesConfigurationFactory implements FactoryBean, /** * Create a new factory for an object of the given type. - * * @see #PropertiesConfigurationFactory(Class) */ @SuppressWarnings("unchecked") diff --git a/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java b/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java index 569431fb7c..b8eed8b829 100644 --- a/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java +++ b/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java @@ -44,12 +44,10 @@ public class PropertySourcesPropertyValues implements PropertyValues { /** * Create a new PropertyValues from the given PropertySources - * * @param propertySources a PropertySources instance */ public PropertySourcesPropertyValues(PropertySources propertySources) { this.propertySources = propertySources; - // TODO: maybe lazy initialization? PropertySourcesPropertyResolver resolver = new PropertySourcesPropertyResolver( propertySources); for (PropertySource source : propertySources) { @@ -93,15 +91,11 @@ public class PropertySourcesPropertyValues implements PropertyValues { public PropertyValues changesSince(PropertyValues old) { MutablePropertyValues changes = new MutablePropertyValues(); // for each property value in the new set - for (PropertyValue newPv : getPropertyValues()) { + for (PropertyValue newValue : getPropertyValues()) { // if there wasn't an old one, add it - PropertyValue pvOld = old.getPropertyValue(newPv.getName()); - if (pvOld == null) { - changes.addPropertyValue(newPv); - } - else if (!pvOld.equals(newPv)) { - // it's changed - changes.addPropertyValue(newPv); + PropertyValue oldValue = old.getPropertyValue(newValue.getName()); + if (oldValue == null || !oldValue.equals(newValue)) { + changes.addPropertyValue(newValue); } } return changes; diff --git a/spring-boot/src/main/java/org/springframework/boot/bind/RelaxedDataBinder.java b/spring-boot/src/main/java/org/springframework/boot/bind/RelaxedDataBinder.java index 64cb9fc1e9..15068140ec 100644 --- a/spring-boot/src/main/java/org/springframework/boot/bind/RelaxedDataBinder.java +++ b/spring-boot/src/main/java/org/springframework/boot/bind/RelaxedDataBinder.java @@ -82,7 +82,6 @@ public class RelaxedDataBinder extends DataBinder { * map keys. Also creates new maps for properties of map type that are null (assuming * all maps are potentially nested). The standard bracket [...] * dereferencing is also accepted. - * * @param propertyValues the property values * @param target the target object */ @@ -146,7 +145,6 @@ public class RelaxedDataBinder extends DataBinder { *
  • Fuzzy matching can be employed for bean property names
  • *
  • Period separators can be used instead of indexing ([...]) for map keys
  • * - * * @param wrapper a bean wrapper for the object to bind * @param path the bean path to bind * @return a transformed path with correct bean wrapper syntax diff --git a/spring-boot/src/main/java/org/springframework/boot/config/JsonParserFactory.java b/spring-boot/src/main/java/org/springframework/boot/config/JsonParserFactory.java index bb3dc2d46d..5b80d3f964 100644 --- a/spring-boot/src/main/java/org/springframework/boot/config/JsonParserFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/config/JsonParserFactory.java @@ -30,8 +30,7 @@ public abstract class JsonParserFactory { /** * Static factory for the "best" JSON parser available on the classpath. Tries Jackson - * (2), then Snake YAML, and then falls back to the {@link SimpleJsonParser}. - * + * 2, then Snake YAML, and then falls back to the {@link SimpleJsonParser}. * @return a {@link JsonParser} */ public static JsonParser getJsonParser() { diff --git a/spring-boot/src/main/java/org/springframework/boot/config/YamlProcessor.java b/spring-boot/src/main/java/org/springframework/boot/config/YamlProcessor.java index 7f513b5f31..1dcfa83b61 100644 --- a/spring-boot/src/main/java/org/springframework/boot/config/YamlProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/config/YamlProcessor.java @@ -72,7 +72,6 @@ public class YamlProcessor { * name=My Cool App * url=http://dev.bar.com * - * * @param matchers a map of keys to value patterns (regular expressions) */ public void setDocumentMatchers(List matchers) { @@ -83,7 +82,6 @@ public class YamlProcessor { * Flag indicating that a document for which all the * {@link #setDocumentMatchers(List) document matchers} abstain will nevertheless * match. - * * @param matchDefault the flag to set (default true) */ public void setMatchDefault(boolean matchDefault) { @@ -94,7 +92,6 @@ public class YamlProcessor { * Method to use for resolving resources. Each resource will be converted to a Map, so * this property is used to decide which map entries to keep in the final output from * this factory. - * * @param resolutionMethod the resolution method to set (defaults to * {@link ResolutionMethod#OVERRIDE}). */ @@ -117,7 +114,6 @@ public class YamlProcessor { * into the callback, along with its representation as Properties. Depending on the * {@link #setResolutionMethod(ResolutionMethod)} not all of the documents will be * parsed. - * * @param callback a callback to delegate to once matching documents are found */ protected void process(MatchCallback callback) { diff --git a/spring-boot/src/main/java/org/springframework/boot/config/YamlPropertySourceLoader.java b/spring-boot/src/main/java/org/springframework/boot/config/YamlPropertySourceLoader.java index b18d86ac1a..66d117b8e1 100644 --- a/spring-boot/src/main/java/org/springframework/boot/config/YamlPropertySourceLoader.java +++ b/spring-boot/src/main/java/org/springframework/boot/config/YamlPropertySourceLoader.java @@ -63,7 +63,6 @@ public class YamlPropertySourceLoader extends PropertiesPropertySourceLoader { /** * A property source loader that loads all properties and matches all documents. - * * @return a property source loader */ public static YamlPropertySourceLoader matchAllLoader() { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/ErrorPage.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/ErrorPage.java index d381c2e12e..055caef6dd 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/ErrorPage.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/ErrorPage.java @@ -54,7 +54,6 @@ public class ErrorPage { * The path to render (usually implemented as a forward), starting with "/". A custom * controller or servlet path can be used, or if the container supports it, a template * path (e.g. "/error.jsp"). - * * @return the path that will be rendered for this error */ public String getPath() { @@ -70,7 +69,6 @@ public class ErrorPage { /** * The HTTP status value that this error page matches. - * * @return the status */ public HttpStatus getStatus() { @@ -79,7 +77,6 @@ public class ErrorPage { /** * The HTTP status value that this error page matches. - * * @return the status value (or 0 for a page that matches any status) */ public int getStatusCode() { @@ -88,8 +85,7 @@ public class ErrorPage { /** * The exception type name. - * - * @return the exception type name (or null if there is none) + * @return the exception type name (or {@code null} if there is none) */ public String getExceptionName() { return this.exception == null ? null : this.exception.getName(); 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 141f30ff19..064af52dea 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 @@ -83,7 +83,6 @@ public class JettyEmbeddedServletContainer implements EmbeddedServletContainer { } catch (InterruptedException ex) { Thread.currentThread().interrupt(); - // No drama } catch (Exception ex) { throw new EmbeddedServletContainerException( diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java index 0afd326ad5..f60b725bd2 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java @@ -274,7 +274,6 @@ public class JettyEmbeddedServletContainerFactory extends /** * Add {@link Configuration}s that will be applied to the {@link WebAppContext} before * the server is started. - * * @param configurations the configurations to add */ public void addConfigurations(Configuration... configurations) { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java index 9cb2713f58..57be0d7c03 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java @@ -332,8 +332,7 @@ public class TomcatEmbeddedServletContainerFactory extends } /** - * Add {@link LifecycleListener}s that should be applied to the Tomcat {@link Context} - * . + * Add {@link LifecycleListener}s that should be added to the Tomcat {@link Context}. * @param contextLifecycleListeners the listeners to add */ public void addContextLifecycleListeners( diff --git a/spring-boot/src/main/java/org/springframework/boot/context/initializer/ContextIdApplicationContextInitializer.java b/spring-boot/src/main/java/org/springframework/boot/context/initializer/ContextIdApplicationContextInitializer.java index 1491043e59..017fdd9d50 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/initializer/ContextIdApplicationContextInitializer.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/initializer/ContextIdApplicationContextInitializer.java @@ -76,15 +76,13 @@ public class ContextIdApplicationContextInitializer implements index); index = environment.getProperty("spring.application.index", Integer.class, index); if (index >= 0) { - name = name + ":" + index; + return name + ":" + index; } - else { - // FIXME do we want this - String profiles = StringUtils.arrayToCommaDelimitedString(environment - .getActiveProfiles()); - if (StringUtils.hasText(profiles)) { - name = name + ":" + profiles; - } + + String profiles = StringUtils.arrayToCommaDelimitedString(environment + .getActiveProfiles()); + if (StringUtils.hasText(profiles)) { + name = name + ":" + profiles; } return name; } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java index b2da2b78ea..5a544b3af8 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java @@ -26,9 +26,8 @@ import java.lang.annotation.Target; * Annotation for externalized configuration. Add this to a class definition if you want * to bind and validate some external Properties (e.g. from a .properties file). * - * @see ConfigurationPropertiesBindingPostProcessor - * * @author Dave Syer + * @see ConfigurationPropertiesBindingPostProcessor */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @@ -39,7 +38,6 @@ public @interface ConfigurationProperties { * The (optional) name of the object to be bound. Properties to bind can have a name * prefix to select the properties that are valid to this object. Synonym for * {@link #name()}. - * * @return the name prefix of the properties to bind */ String value() default ""; @@ -48,7 +46,6 @@ public @interface ConfigurationProperties { * The (optional) name of the object to be bound. Properties to bind can have a name * prefix to select the properties that are valid to this object. Synonym for * {@link #value()}. - * * @return the name prefix of the properties to bind */ String name() default ""; @@ -57,7 +54,6 @@ public @interface ConfigurationProperties { * Flag to indicate that when binding to this object invalid fields should be ignored. * Invalid means invalid according to the binder that is used, and usually this means * fields of the wrong type (or that cannot be coerced into the correct type). - * * @return the flag value (default false) */ boolean ignoreInvalidFields() default false; @@ -65,7 +61,6 @@ public @interface ConfigurationProperties { /** * Flag to indicate that when binding to this object unknown fields should be ignored. * An unknown field could be a sign of a mistake in the Properties. - * * @return the flag value (default true) */ boolean ignoreUnknownFields() default true; @@ -73,7 +68,6 @@ public @interface ConfigurationProperties { /** * Optionally provide an explicit resource path to bind to instead of using the * default environment. - * * @return the path (or paths) of resources to bind to */ String[] path() default {};