Skip to content

Commit 015f7d8

Browse files
committed
Polishing
1 parent da4e271 commit 015f7d8

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,9 +43,9 @@
4343
* Internal class that caches JavaBeans {@link java.beans.PropertyDescriptor}
4444
* information for a Java class. Not intended for direct use by application code.
4545
*
46-
* <p>Necessary for own caching of descriptors within the application's
47-
* ClassLoader, rather than rely on the JDK's system-wide BeanInfo cache
48-
* (in order to avoid leaks on ClassLoader shutdown).
46+
* <p>Necessary for Spring's own caching of bean descriptors within the application
47+
* {@link ClassLoader}, rather than relying on the JDK's system-wide {@link BeanInfo}
48+
* cache (in order to avoid leaks on individual application shutdown in a shared JVM).
4949
*
5050
* <p>Information is cached statically, so we don't need to create new
5151
* objects of this class for every JavaBean we manipulate. Hence, this class
@@ -163,7 +163,6 @@ public static void clearClassLoader(@Nullable ClassLoader classLoader) {
163163
* @return the corresponding CachedIntrospectionResults
164164
* @throws BeansException in case of introspection failure
165165
*/
166-
@SuppressWarnings("unchecked")
167166
static CachedIntrospectionResults forClass(Class<?> beanClass) throws BeansException {
168167
CachedIntrospectionResults results = strongClassCache.get(beanClass);
169168
if (results != null) {

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,30 +1127,30 @@ public boolean equals(Object other) {
11271127
return false;
11281128
}
11291129
AbstractBeanDefinition that = (AbstractBeanDefinition) other;
1130-
boolean rtn = ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName());
1131-
rtn = rtn && ObjectUtils.nullSafeEquals(this.scope, that.scope);
1132-
rtn = rtn && this.abstractFlag == that.abstractFlag;
1133-
rtn = rtn && this.lazyInit == that.lazyInit;
1134-
rtn = rtn && this.autowireMode == that.autowireMode;
1135-
rtn = rtn && this.dependencyCheck == that.dependencyCheck;
1136-
rtn = rtn && Arrays.equals(this.dependsOn, that.dependsOn);
1137-
rtn = rtn && this.autowireCandidate == that.autowireCandidate;
1138-
rtn = rtn && ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers);
1139-
rtn = rtn && this.primary == that.primary;
1140-
rtn = rtn && this.nonPublicAccessAllowed == that.nonPublicAccessAllowed;
1141-
rtn = rtn && this.lenientConstructorResolution == that.lenientConstructorResolution;
1142-
rtn = rtn && ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues);
1143-
rtn = rtn && ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues);
1144-
rtn = rtn && ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides);
1145-
rtn = rtn && ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName);
1146-
rtn = rtn && ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName);
1147-
rtn = rtn && ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName);
1148-
rtn = rtn && this.enforceInitMethod == that.enforceInitMethod;
1149-
rtn = rtn && ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName);
1150-
rtn = rtn && this.enforceDestroyMethod == that.enforceDestroyMethod;
1151-
rtn = rtn && this.synthetic == that.synthetic;
1152-
rtn = rtn && this.role == that.role;
1153-
return rtn && super.equals(other);
1130+
return (ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName()) &&
1131+
ObjectUtils.nullSafeEquals(this.scope, that.scope) &&
1132+
this.abstractFlag == that.abstractFlag &&
1133+
this.lazyInit == that.lazyInit &&
1134+
this.autowireMode == that.autowireMode &&
1135+
this.dependencyCheck == that.dependencyCheck &&
1136+
Arrays.equals(this.dependsOn, that.dependsOn) &&
1137+
this.autowireCandidate == that.autowireCandidate &&
1138+
ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers) &&
1139+
this.primary == that.primary &&
1140+
this.nonPublicAccessAllowed == that.nonPublicAccessAllowed &&
1141+
this.lenientConstructorResolution == that.lenientConstructorResolution &&
1142+
ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues) &&
1143+
ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues) &&
1144+
ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides) &&
1145+
ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName) &&
1146+
ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName) &&
1147+
ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName) &&
1148+
this.enforceInitMethod == that.enforceInitMethod &&
1149+
ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName) &&
1150+
this.enforceDestroyMethod == that.enforceDestroyMethod &&
1151+
this.synthetic == that.synthetic &&
1152+
this.role == that.role &&
1153+
super.equals(other));
11541154
}
11551155

11561156
@Override

0 commit comments

Comments
 (0)