Browse Source

Polishing

pull/24195/head
Juergen Hoeller 6 years ago
parent
commit
9af8dc0980
  1. 9
      spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java
  2. 48
      spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -43,9 +43,9 @@ import org.springframework.util.StringUtils; @@ -43,9 +43,9 @@ import org.springframework.util.StringUtils;
* Internal class that caches JavaBeans {@link java.beans.PropertyDescriptor}
* information for a Java class. Not intended for direct use by application code.
*
* <p>Necessary for own caching of descriptors within the application's
* ClassLoader, rather than rely on the JDK's system-wide BeanInfo cache
* (in order to avoid leaks on ClassLoader shutdown).
* <p>Necessary for Spring's own caching of bean descriptors within the application
* {@link ClassLoader}, rather than relying on the JDK's system-wide {@link BeanInfo}
* cache (in order to avoid leaks on individual application shutdown in a shared JVM).
*
* <p>Information is cached statically, so we don't need to create new
* objects of this class for every JavaBean we manipulate. Hence, this class
@ -163,7 +163,6 @@ public final class CachedIntrospectionResults { @@ -163,7 +163,6 @@ public final class CachedIntrospectionResults {
* @return the corresponding CachedIntrospectionResults
* @throws BeansException in case of introspection failure
*/
@SuppressWarnings("unchecked")
static CachedIntrospectionResults forClass(Class<?> beanClass) throws BeansException {
CachedIntrospectionResults results = strongClassCache.get(beanClass);
if (results != null) {

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

@ -1161,30 +1161,30 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess @@ -1161,30 +1161,30 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
return false;
}
AbstractBeanDefinition that = (AbstractBeanDefinition) other;
return ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName())
&& ObjectUtils.nullSafeEquals(this.scope, that.scope)
&& this.abstractFlag == that.abstractFlag
&& this.lazyInit == that.lazyInit
&& this.autowireMode == that.autowireMode
&& this.dependencyCheck == that.dependencyCheck
&& Arrays.equals(this.dependsOn, that.dependsOn)
&& this.autowireCandidate == that.autowireCandidate
&& ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers)
&& this.primary == that.primary
&& this.nonPublicAccessAllowed == that.nonPublicAccessAllowed
&& this.lenientConstructorResolution == that.lenientConstructorResolution
&& ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues)
&& ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues)
&& ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides)
&& ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName)
&& ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName)
&& ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName)
&& this.enforceInitMethod == that.enforceInitMethod
&& ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName)
&& this.enforceDestroyMethod == that.enforceDestroyMethod
&& this.synthetic == that.synthetic
&& this.role == that.role
&& super.equals(other);
return (ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName()) &&
ObjectUtils.nullSafeEquals(this.scope, that.scope) &&
this.abstractFlag == that.abstractFlag &&
this.lazyInit == that.lazyInit &&
this.autowireMode == that.autowireMode &&
this.dependencyCheck == that.dependencyCheck &&
Arrays.equals(this.dependsOn, that.dependsOn) &&
this.autowireCandidate == that.autowireCandidate &&
ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers) &&
this.primary == that.primary &&
this.nonPublicAccessAllowed == that.nonPublicAccessAllowed &&
this.lenientConstructorResolution == that.lenientConstructorResolution &&
ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues) &&
ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues) &&
ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides) &&
ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName) &&
ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName) &&
ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName) &&
this.enforceInitMethod == that.enforceInitMethod &&
ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName) &&
this.enforceDestroyMethod == that.enforceDestroyMethod &&
this.synthetic == that.synthetic &&
this.role == that.role &&
super.equals(other));
}
@Override

Loading…
Cancel
Save