Skip to content

Commit 60b24cf

Browse files
committed
Related polishing
Issue: SPR-11386 (cherry picked from commit 6634c19)
1 parent 036bd79 commit 60b24cf

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,15 @@ public class CachedIntrospectionResults {
9292
public static final String IGNORE_BEANINFO_PROPERTY_NAME = "spring.beaninfo.ignore";
9393

9494

95-
private static final Log logger = LogFactory.getLog(CachedIntrospectionResults.class);
96-
97-
private static final boolean shouldIntrospectorIgnoreBeaninfoClasses;
95+
private static final boolean shouldIntrospectorIgnoreBeaninfoClasses =
96+
SpringProperties.getFlag(IGNORE_BEANINFO_PROPERTY_NAME);
9897

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

102+
private static final Log logger = LogFactory.getLog(CachedIntrospectionResults.class);
103+
103104
/**
104105
* Set of ClassLoaders that this CachedIntrospectionResults class will always
105106
* accept classes from, even if the classes do not qualify as cache-safe.
@@ -114,11 +115,6 @@ public class CachedIntrospectionResults {
114115
static final Map<Class<?>, Object> classCache = new WeakHashMap<Class<?>, Object>();
115116

116117

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

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

Lines changed: 1 addition & 6 deletions
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)