Skip to content

Commit

Permalink
Fix more test compilation logging errors
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Dec 10, 2014
1 parent d834dcf commit 088e892
Show file tree
Hide file tree
Showing 2 changed files with 638 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,7 @@ private static boolean isUnderneathClassLoader(ClassLoader candidate, ClassLoade
*/
private CachedIntrospectionResults(Class<?> beanClass) throws BeansException {
try {
BeanInfo beanInfo = null;
for (BeanInfoFactory beanInfoFactory : beanInfoFactories) {
beanInfo = beanInfoFactory.getBeanInfo(beanClass);
if (beanInfo != null) {
break;
}
}
BeanInfo beanInfo = new ExtendedBeanInfo(Introspector.getBeanInfo(beanClass));
if (beanInfo == null) {
// If none of the factories supported the class, fall back to the default
beanInfo = (shouldIntrospectorIgnoreBeaninfoClasses ?
Expand Down Expand Up @@ -463,22 +457,10 @@ public boolean equals(Object other) {
return false;
}
GenericTypeAwarePropertyDescriptor otherPd = (GenericTypeAwarePropertyDescriptor) other;
return (getBeanClass().equals(otherPd.getBeanClass()) && equals(this, otherPd));
return (getBeanClass().equals(otherPd.getBeanClass()) && CachedIntrospectionResults.equals(this, otherPd));
}

/**
* Compare the given {@code PropertyDescriptors} and return {@code true} if
* they are equivalent, i.e. their read method, write method, property type,
* property editor and flags are equivalent.
* @see java.beans.PropertyDescriptor#equals(Object)
*/
public boolean equals(PropertyDescriptor pd, PropertyDescriptor otherPd) {
return (ObjectUtils.nullSafeEquals(pd.getReadMethod(), otherPd.getReadMethod()) &&
ObjectUtils.nullSafeEquals(pd.getWriteMethod(), otherPd.getWriteMethod()) &&
ObjectUtils.nullSafeEquals(pd.getPropertyType(), otherPd.getPropertyType()) &&
ObjectUtils.nullSafeEquals(pd.getPropertyEditorClass(), otherPd.getPropertyEditorClass()) &&
pd.isBound() == otherPd.isBound() && pd.isConstrained() == otherPd.isConstrained());
}


@Override
public int hashCode() {
Expand All @@ -489,4 +471,18 @@ public int hashCode() {
}

}

/**
* Compare the given {@code PropertyDescriptors} and return {@code true} if
* they are equivalent, i.e. their read method, write method, property type,
* property editor and flags are equivalent.
* @see java.beans.PropertyDescriptor#equals(Object)
*/
public static boolean equals(PropertyDescriptor pd, PropertyDescriptor otherPd) {
return (ObjectUtils.nullSafeEquals(pd.getReadMethod(), otherPd.getReadMethod()) &&
ObjectUtils.nullSafeEquals(pd.getWriteMethod(), otherPd.getWriteMethod()) &&
ObjectUtils.nullSafeEquals(pd.getPropertyType(), otherPd.getPropertyType()) &&
ObjectUtils.nullSafeEquals(pd.getPropertyEditorClass(), otherPd.getPropertyEditorClass()) &&
pd.isBound() == otherPd.isBound() && pd.isConstrained() == otherPd.isConstrained());
}
}
Loading

0 comments on commit 088e892

Please sign in to comment.