Polishing

This commit is contained in:
Juergen Hoeller
2019-12-11 17:04:49 +01:00
parent 8ac222467b
commit 9af8dc0980
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

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