Polishing

This commit is contained in:
Juergen Hoeller
2019-12-11 17:13:02 +01:00
parent da4e2710b4
commit 015f7d8ce1
2 changed files with 28 additions and 29 deletions

View File

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

View File

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