Skip to content

Commit 6634c19

Browse files
committed
Related polishing
Issue: SPR-11386
1 parent 60c1905 commit 6634c19

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,15 @@ public class CachedIntrospectionResults {
9494
public static final String IGNORE_BEANINFO_PROPERTY_NAME = "spring.beaninfo.ignore";
9595

9696

97-
private static final Log logger = LogFactory.getLog(CachedIntrospectionResults.class);
98-
99-
private static final boolean shouldIntrospectorIgnoreBeaninfoClasses;
97+
private static final boolean shouldIntrospectorIgnoreBeaninfoClasses =
98+
SpringProperties.getFlag(IGNORE_BEANINFO_PROPERTY_NAME);
10099

101100
/** Stores the BeanInfoFactory instances */
102101
private static List<BeanInfoFactory> beanInfoFactories = SpringFactoriesLoader.loadFactories(
103102
BeanInfoFactory.class, CachedIntrospectionResults.class.getClassLoader());
104103

104+
private static final Log logger = LogFactory.getLog(CachedIntrospectionResults.class);
105+
105106
/**
106107
* Set of ClassLoaders that this CachedIntrospectionResults class will always
107108
* accept classes from, even if the classes do not qualify as cache-safe.
@@ -116,11 +117,6 @@ public class CachedIntrospectionResults {
116117
static final Map<Class<?>, Object> classCache = new WeakHashMap<Class<?>, Object>();
117118

118119

119-
static {
120-
shouldIntrospectorIgnoreBeaninfoClasses = SpringProperties.getFlag(IGNORE_BEANINFO_PROPERTY_NAME);
121-
}
122-
123-
124120
/**
125121
* Accept the given ClassLoader as cache-safe, even if its classes would
126122
* not qualify as cache-safe in this CachedIntrospectionResults class.

spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
6666
*/
6767
public static final String IGNORE_GETENV_PROPERTY_NAME = "spring.getenv.ignore";
6868

69-
7069
/**
7170
* Name of property to set to specify active profiles: {@value}. Value may be comma
7271
* delimited.
@@ -122,14 +121,10 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
122121
* @see #customizePropertySources(MutablePropertySources)
123122
*/
124123
public AbstractEnvironment() {
125-
String name = getClass().getSimpleName();
126-
if (this.logger.isDebugEnabled()) {
127-
this.logger.debug(format("Initializing new %s", name));
128-
}
129124
customizePropertySources(this.propertySources);
130125
if (this.logger.isDebugEnabled()) {
131126
this.logger.debug(format(
132-
"Initialized %s with PropertySources %s", name, this.propertySources));
127+
"Initialized %s with PropertySources %s", getClass().getSimpleName(), this.propertySources));
133128
}
134129
}
135130

0 commit comments

Comments
 (0)