From 60b24cffdba6a2d758bf92289321559d39ba2c74 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 4 Feb 2014 16:45:14 +0100 Subject: [PATCH] Related polishing Issue: SPR-11386 (cherry picked from commit 6634c19) --- .../beans/CachedIntrospectionResults.java | 12 ++++-------- .../core/env/AbstractEnvironment.java | 7 +------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java b/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java index edf833b3e2b..d61ed618125 100644 --- a/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java +++ b/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java @@ -92,14 +92,15 @@ public class CachedIntrospectionResults { public static final String IGNORE_BEANINFO_PROPERTY_NAME = "spring.beaninfo.ignore"; - private static final Log logger = LogFactory.getLog(CachedIntrospectionResults.class); - - private static final boolean shouldIntrospectorIgnoreBeaninfoClasses; + private static final boolean shouldIntrospectorIgnoreBeaninfoClasses = + SpringProperties.getFlag(IGNORE_BEANINFO_PROPERTY_NAME); /** Stores the BeanInfoFactory instances */ private static List beanInfoFactories = SpringFactoriesLoader.loadFactories( BeanInfoFactory.class, CachedIntrospectionResults.class.getClassLoader()); + private static final Log logger = LogFactory.getLog(CachedIntrospectionResults.class); + /** * Set of ClassLoaders that this CachedIntrospectionResults class will always * accept classes from, even if the classes do not qualify as cache-safe. @@ -114,11 +115,6 @@ public class CachedIntrospectionResults { static final Map, Object> classCache = new WeakHashMap, Object>(); - static { - shouldIntrospectorIgnoreBeaninfoClasses = SpringProperties.getFlag(IGNORE_BEANINFO_PROPERTY_NAME); - } - - /** * Accept the given ClassLoader as cache-safe, even if its classes would * not qualify as cache-safe in this CachedIntrospectionResults class. diff --git a/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java b/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java index f1639394977..7e3effc720d 100644 --- a/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java +++ b/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java @@ -66,7 +66,6 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { */ public static final String IGNORE_GETENV_PROPERTY_NAME = "spring.getenv.ignore"; - /** * Name of property to set to specify active profiles: {@value}. Value may be comma * delimited. @@ -122,14 +121,10 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { * @see #customizePropertySources(MutablePropertySources) */ public AbstractEnvironment() { - String name = getClass().getSimpleName(); - if (this.logger.isDebugEnabled()) { - this.logger.debug(format("Initializing new %s", name)); - } customizePropertySources(this.propertySources); if (this.logger.isDebugEnabled()) { this.logger.debug(format( - "Initialized %s with PropertySources %s", name, this.propertySources)); + "Initialized %s with PropertySources %s", getClass().getSimpleName(), this.propertySources)); } }