From 6431fef91e57ccdeedc3b64e493aad7a78c18473 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 30 Jan 2014 12:54:58 -0800 Subject: [PATCH] Polish --- .../ConfigurationPropertiesReportEndpoint.java | 11 +++++++++-- .../data/MongoRepositoriesAutoConfiguration.java | 4 ++-- .../org/springframework/boot/SpringApplication.java | 4 ---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java index a4c4ffd972..363f58563f 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java @@ -109,9 +109,14 @@ public class ConfigurationPropertiesReportEndpoint extends protected void configureObjectMapper(ObjectMapper mapper) { mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + applyCglibFilters(mapper); + } - // configure PropertyFiler to make sure Jackson doesn't process CGLIB generated - // bean properties + /** + * configure PropertyFiler to make sure Jackson doesn't process CGLIB generated bean + * properties + */ + private void applyCglibFilters(ObjectMapper mapper) { mapper.setAnnotationIntrospector(new CglibAnnotationIntrospector()); mapper.setFilters(new SimpleFilterProvider().addFilter(CGLIB_FILTER_ID, new CglibBeanPropertyFilter())); @@ -161,6 +166,7 @@ public class ConfigurationPropertiesReportEndpoint extends } return id; } + } /** @@ -182,6 +188,7 @@ public class ConfigurationPropertiesReportEndpoint extends private boolean include(String name) { return !name.startsWith("$$"); } + } } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/MongoRepositoriesAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/MongoRepositoriesAutoConfiguration.java index 38992674fa..d332fb5b93 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/MongoRepositoriesAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/MongoRepositoriesAutoConfiguration.java @@ -101,8 +101,8 @@ public class MongoRepositoriesAutoConfiguration { } public Mongo mongo() throws UnknownHostException { - return this.host != null ? new MongoClient(this.host, this.port) - : new MongoClient(new MongoClientURI(this.uri)); + return (this.host != null ? new MongoClient(this.host, this.port) + : new MongoClient(new MongoClientURI(this.uri))); } public void setHost(String host) { diff --git a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index 58eb4744f9..e5f8eab4a3 100644 --- a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -501,7 +501,6 @@ public class SpringApplication { /** * Called to log startup information, subclasses may override to add additional * logging. - * * @param isRoot true if this application is the root of a context hierarchy */ protected void logStartupInfo(boolean isRoot) { @@ -601,7 +600,6 @@ public class SpringApplication { /** * The ResourceLoader that will be used in the ApplicationContext. - * * @return the resourceLoader the resource loader that will be used in the * ApplicationContext (or null if the default) */ @@ -613,7 +611,6 @@ public class SpringApplication { * Either the ClassLoader that will be used in the ApplicationContext (if * {@link #setResourceLoader(ResourceLoader) resourceLoader} is set, or the context * class loader (if not null), or the loader of the Spring {@link ClassUtils} class. - * * @return a ClassLoader (never null) */ public ClassLoader getClassLoader() { @@ -739,7 +736,6 @@ public class SpringApplication { /** * Convenient alternative to {@link #setDefaultProperties(Map)}. - * * @param defaultProperties some {@link Properties} */ public void setDefaultProperties(Properties defaultProperties) {