提交 c8e5aa07 编写于 作者: A Arjen Poutsma

Added @Override annotations to beans module

上级 c07477da
......@@ -111,6 +111,7 @@ public abstract class AbstractPropertyAccessor extends PropertyEditorRegistrySup
// Redefined with public visibility.
@Override
public Class getPropertyType(String propertyPath) {
return null;
}
......
......@@ -74,6 +74,7 @@ public class BeanMetadataAttribute implements BeanMetadataElement {
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -87,10 +88,12 @@ public class BeanMetadataAttribute implements BeanMetadataElement {
ObjectUtils.nullSafeEquals(this.source, otherMa.source));
}
@Override
public int hashCode() {
return this.name.hashCode() * 29 + ObjectUtils.nullSafeHashCode(this.value);
}
@Override
public String toString() {
return "metadata attribute '" + this.name + "'";
}
......
......@@ -62,15 +62,18 @@ public class BeanMetadataAttributeAccessor extends AttributeAccessorSupport impl
return (BeanMetadataAttribute) super.getAttribute(name);
}
@Override
public void setAttribute(String name, Object value) {
super.setAttribute(name, new BeanMetadataAttribute(name, value));
}
@Override
public Object getAttribute(String name) {
BeanMetadataAttribute attribute = (BeanMetadataAttribute) super.getAttribute(name);
return (attribute != null ? attribute.getValue() : null);
}
@Override
public Object removeAttribute(String name) {
BeanMetadataAttribute attribute = (BeanMetadataAttribute) super.removeAttribute(name);
return (attribute != null ? attribute.getValue() : null);
......
......@@ -282,6 +282,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
return nestedBw.getCachedIntrospectionResults().getPropertyDescriptor(getFinalPath(nestedBw, propertyName));
}
@Override
public Class getPropertyType(String propertyName) throws BeansException {
try {
PropertyDescriptor pd = getPropertyDescriptorInternal(propertyName);
......@@ -527,6 +528,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
// Implementation of PropertyAccessor interface
//---------------------------------------------------------------------
@Override
public Object getPropertyValue(String propertyName) throws BeansException {
BeanWrapperImpl nestedBw = getBeanWrapperForPropertyPath(propertyName);
PropertyTokenHolder tokens = getPropertyNameTokens(getFinalPath(nestedBw, propertyName));
......@@ -620,6 +622,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
}
}
@Override
public void setPropertyValue(String propertyName, Object value) throws BeansException {
BeanWrapperImpl nestedBw = null;
try {
......@@ -633,6 +636,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
nestedBw.setPropertyValue(tokens, new PropertyValue(propertyName, value));
}
@Override
public void setPropertyValue(PropertyValue pv) throws BeansException {
PropertyTokenHolder tokens = (PropertyTokenHolder) pv.resolvedTokens;
if (tokens == null) {
......@@ -864,6 +868,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer(getClass().getName());
if (this.object != null) {
......
......@@ -50,6 +50,7 @@ public abstract class BeansException extends NestedRuntimeException {
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -62,6 +63,7 @@ public abstract class BeansException extends NestedRuntimeException {
ObjectUtils.nullSafeEquals(getCause(), otherBe.getCause()));
}
@Override
public int hashCode() {
return getMessage().hashCode();
}
......
......@@ -77,6 +77,7 @@ public class DirectFieldAccessor extends AbstractPropertyAccessor {
return this.fieldMap.containsKey(propertyName);
}
@Override
public Class getPropertyType(String propertyName) throws BeansException {
Field field = (Field) this.fieldMap.get(propertyName);
if (field != null) {
......@@ -85,6 +86,7 @@ public class DirectFieldAccessor extends AbstractPropertyAccessor {
return null;
}
@Override
public Object getPropertyValue(String propertyName) throws BeansException {
Field field = (Field) this.fieldMap.get(propertyName);
if (field == null) {
......@@ -100,6 +102,7 @@ public class DirectFieldAccessor extends AbstractPropertyAccessor {
}
}
@Override
public void setPropertyValue(String propertyName, Object newValue) throws BeansException {
Field field = (Field) this.fieldMap.get(propertyName);
if (field == null) {
......
......@@ -70,18 +70,22 @@ class GenericTypeAwarePropertyDescriptor extends PropertyDescriptor {
}
@Override
public Method getReadMethod() {
return this.readMethod;
}
@Override
public Method getWriteMethod() {
return this.writeMethod;
}
@Override
public Class getPropertyEditorClass() {
return this.propertyEditorClass;
}
@Override
public synchronized Class getPropertyType() {
if (this.propertyType == null) {
if (this.readMethod != null) {
......
......@@ -325,6 +325,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -336,10 +337,12 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
return this.propertyValueList.equals(that.propertyValueList);
}
@Override
public int hashCode() {
return this.propertyValueList.hashCode();
}
@Override
public String toString() {
PropertyValue[] pvs = getPropertyValues();
StringBuffer sb = new StringBuffer("PropertyValues: length=" + pvs.length + "; ");
......
......@@ -80,6 +80,7 @@ public class PropertyBatchUpdateException extends BeansException {
}
@Override
public String getMessage() {
StringBuffer sb = new StringBuffer("Failed properties: ");
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
......@@ -91,6 +92,7 @@ public class PropertyBatchUpdateException extends BeansException {
return sb.toString();
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(getClass().getName()).append("; nested PropertyAccessExceptions (");
......@@ -102,6 +104,7 @@ public class PropertyBatchUpdateException extends BeansException {
return sb.toString();
}
@Override
public void printStackTrace(PrintStream ps) {
synchronized (ps) {
ps.println(getClass().getName() + "; nested PropertyAccessException details (" +
......@@ -113,6 +116,7 @@ public class PropertyBatchUpdateException extends BeansException {
}
}
@Override
public void printStackTrace(PrintWriter pw) {
synchronized (pw) {
pw.println(getClass().getName() + "; nested PropertyAccessException details (" +
......@@ -124,6 +128,7 @@ public class PropertyBatchUpdateException extends BeansException {
}
}
@Override
public boolean contains(Class exType) {
if (exType == null) {
return false;
......
......@@ -160,6 +160,7 @@ public class PropertyValue extends BeanMetadataAttributeAccessor implements Seri
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -173,10 +174,12 @@ public class PropertyValue extends BeanMetadataAttributeAccessor implements Seri
ObjectUtils.nullSafeEquals(this.source, otherPv.source));
}
@Override
public int hashCode() {
return this.name.hashCode() * 29 + ObjectUtils.nullSafeHashCode(this.value);
}
@Override
public String toString() {
return "bean property '" + this.name + "'";
}
......
......@@ -38,6 +38,7 @@ public class PropertyValuesEditor extends PropertyEditorSupport {
private final PropertiesEditor propertiesEditor = new PropertiesEditor();
@Override
public void setAsText(String text) throws IllegalArgumentException {
this.propertiesEditor.setAsText(text);
Properties props = (Properties) this.propertiesEditor.getValue();
......
......@@ -146,6 +146,7 @@ public class BeanCreationException extends FatalBeanException {
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
if (this.relatedCauses != null) {
......@@ -158,6 +159,7 @@ public class BeanCreationException extends FatalBeanException {
return sb.toString();
}
@Override
public void printStackTrace(PrintStream ps) {
synchronized (ps) {
super.printStackTrace(ps);
......@@ -171,6 +173,7 @@ public class BeanCreationException extends FatalBeanException {
}
}
@Override
public void printStackTrace(PrintWriter pw) {
synchronized (pw) {
super.printStackTrace(pw);
......@@ -184,6 +187,7 @@ public class BeanCreationException extends FatalBeanException {
}
}
@Override
public boolean contains(Class exClass) {
if (super.contains(exClass)) {
return true;
......
......@@ -42,6 +42,7 @@ public class SimpleSpringBeanELResolver extends SpringBeanELResolver {
this.beanFactory = beanFactory;
}
@Override
protected BeanFactory getBeanFactory(ELContext elContext) {
return this.beanFactory;
}
......
......@@ -43,6 +43,7 @@ public abstract class SpringBeanELResolver extends ELResolver {
protected final Log logger = LogFactory.getLog(getClass());
@Override
public Object getValue(ELContext elContext, Object base, Object property) throws ELException {
if (base == null) {
String beanName = property.toString();
......@@ -58,6 +59,7 @@ public abstract class SpringBeanELResolver extends ELResolver {
return null;
}
@Override
public Class<?> getType(ELContext elContext, Object base, Object property) throws ELException {
if (base == null) {
String beanName = property.toString();
......@@ -70,6 +72,7 @@ public abstract class SpringBeanELResolver extends ELResolver {
return null;
}
@Override
public void setValue(ELContext elContext, Object base, Object property, Object value) throws ELException {
if (base == null) {
String beanName = property.toString();
......@@ -81,6 +84,7 @@ public abstract class SpringBeanELResolver extends ELResolver {
}
}
@Override
public boolean isReadOnly(ELContext elContext, Object base, Object property) throws ELException {
if (base == null) {
String beanName = property.toString();
......@@ -92,10 +96,12 @@ public abstract class SpringBeanELResolver extends ELResolver {
return false;
}
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext elContext, Object base) {
return null;
}
@Override
public Class<?> getCommonPropertyType(ELContext elContext, Object base) {
return Object.class;
}
......
......@@ -181,6 +181,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
}
}
@Override
public Constructor[] determineCandidateConstructors(Class beanClass, String beanName) throws BeansException {
// Quick check on the concurrent map first, with minimal locking.
Constructor[] candidateConstructors = this.candidateConstructorsCache.get(beanClass);
......@@ -234,6 +235,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
return (candidateConstructors.length > 0 ? candidateConstructors : null);
}
@Override
public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {
InjectionMetadata metadata = findAutowiringMetadata(bean.getClass());
try {
......@@ -245,6 +247,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
return true;
}
@Override
public PropertyValues postProcessPropertyValues(
PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) throws BeansException {
......
......@@ -297,11 +297,13 @@ public class InitDestroyAnnotationBeanPostProcessor
this.method.invoke(target, (Object[]) null);
}
@Override
public boolean equals(Object other) {
return (this == other || (other instanceof LifecycleElement &&
this.method.getName().equals(((LifecycleElement) other).method.getName())));
}
@Override
public int hashCode() {
return this.method.getName().hashCode();
}
......
......@@ -222,6 +222,7 @@ public class InjectionMetadata {
return null;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -241,10 +242,12 @@ public class InjectionMetadata {
}
}
@Override
public int hashCode() {
return this.member.getClass().hashCode() * 29 + this.member.getName().hashCode();
}
@Override
public String toString() {
return getClass().getSimpleName() + " for " + this.member;
}
......
......@@ -106,6 +106,7 @@ public class RequiredAnnotationBeanPostProcessor extends InstantiationAwareBeanP
}
@Override
public PropertyValues postProcessPropertyValues(
PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
throws BeansException {
......
......@@ -145,11 +145,13 @@ public class BeanDefinitionHolder implements BeanMetadataElement {
* @see #getLongDescription()
* @see #getShortDescription()
*/
@Override
public String toString() {
return getLongDescription();
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -163,6 +165,7 @@ public class BeanDefinitionHolder implements BeanMetadataElement {
ObjectUtils.nullSafeEquals(this.aliases, otherHolder.aliases);
}
@Override
public int hashCode() {
int hashCode = this.beanDefinition.hashCode();
hashCode = 29 * hashCode + this.beanName.hashCode();
......
......@@ -312,6 +312,7 @@ public class ConstructorArgumentValues {
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -344,6 +345,7 @@ public class ConstructorArgumentValues {
return true;
}
@Override
public int hashCode() {
int hashCode = 7;
for (Iterator it = this.genericArgumentValues.iterator(); it.hasNext();) {
......
......@@ -65,10 +65,12 @@ public class ListFactoryBean extends AbstractFactoryBean {
}
@Override
public Class getObjectType() {
return List.class;
}
@Override
protected Object createInstance() {
if (this.sourceList == null) {
throw new IllegalArgumentException("'sourceList' is required");
......
......@@ -65,10 +65,12 @@ public class MapFactoryBean extends AbstractFactoryBean {
}
@Override
public Class getObjectType() {
return Map.class;
}
@Override
protected Object createInstance() {
if (this.sourceMap == null) {
throw new IllegalArgumentException("'sourceMap' is required");
......
......@@ -118,6 +118,7 @@ public class MethodInvokingFactoryBean extends ArgumentConvertingMethodInvoker
this.beanClassLoader = classLoader;
}
@Override
protected Class resolveClassName(String className) throws ClassNotFoundException {
return ClassUtils.forName(className, this.beanClassLoader);
}
......@@ -133,6 +134,7 @@ public class MethodInvokingFactoryBean extends ArgumentConvertingMethodInvoker
* if possible.
* @see ConfigurableBeanFactory#getTypeConverter()
*/
@Override
protected TypeConverter getDefaultTypeConverter() {
if (this.beanFactory != null) {
return this.beanFactory.getTypeConverter();
......
......@@ -110,16 +110,19 @@ public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean {
this.targetBeanName = targetBeanName;
}
@Override
public void afterPropertiesSet() throws Exception {
Assert.hasText(this.targetBeanName, "Property 'targetBeanName' is required");
super.afterPropertiesSet();
}
@Override
public Class getObjectType() {
return ObjectFactory.class;
}
@Override
protected Object createInstance() {
return new ObjectFactory() {
public Object getObject() throws BeansException {
......
......@@ -86,6 +86,7 @@ public class PreferencesPlaceholderConfigurer extends PropertyPlaceholderConfigu
* in the user preferences, then in the system preferences, then in
* the passed-in properties.
*/
@Override
protected String resolvePlaceholder(String placeholder, Properties props) {
String path = null;
String key = placeholder;
......
......@@ -93,6 +93,7 @@ public class PropertyOverrideConfigurer extends PropertyResourceConfigurer {
}
@Override
protected void processProperties(ConfigurableListableBeanFactory beanFactory, Properties props)
throws BeansException {
......
......@@ -249,6 +249,7 @@ public class PropertyPlaceholderConfigurer extends PropertyResourceConfigurer
}
@Override
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
throws BeansException {
......
......@@ -61,6 +61,7 @@ public class RuntimeBeanNameReference implements BeanReference {
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -72,10 +73,12 @@ public class RuntimeBeanNameReference implements BeanReference {
return this.beanName.equals(that.beanName);
}
@Override
public int hashCode() {
return this.beanName.hashCode();
}
@Override
public String toString() {
return '<' + getBeanName() + '>';
}
......
......@@ -86,6 +86,7 @@ public class RuntimeBeanReference implements BeanReference {
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -97,12 +98,14 @@ public class RuntimeBeanReference implements BeanReference {
return (this.beanName.equals(that.beanName) && this.toParent == that.toParent);
}
@Override
public int hashCode() {
int result = this.beanName.hashCode();
result = 29 * result + (this.toParent ? 1 : 0);
return result;
}
@Override
public String toString() {
return '<' + getBeanName() + '>';
}
......
......@@ -65,10 +65,12 @@ public class SetFactoryBean extends AbstractFactoryBean {
}
@Override
public Class getObjectType() {
return Set.class;
}
@Override
protected Object createInstance() {
if (this.sourceSet == null) {
throw new IllegalArgumentException("'sourceSet' is required");
......
......@@ -170,6 +170,7 @@ public class TypedStringValue implements BeanMetadataElement {
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -182,10 +183,12 @@ public class TypedStringValue implements BeanMetadataElement {
ObjectUtils.nullSafeEquals(this.targetType, otherValue.targetType));
}
@Override
public int hashCode() {
return ObjectUtils.nullSafeHashCode(this.value) * 29 + ObjectUtils.nullSafeHashCode(this.targetType);
}
@Override
public String toString() {
return "TypedStringValue: value [" + this.value + "], target type [" + this.targetType + "]";
}
......
......@@ -63,6 +63,7 @@ public abstract class AbstractComponentDefinition implements ComponentDefinition
/**
* Delegates to {@link #getDescription}.
*/
@Override
public String toString() {
return getDescription();
}
......
......@@ -119,6 +119,7 @@ public class BeanComponentDefinition extends BeanDefinitionHolder implements Com
* This implementation returns this ComponentDefinition's description.
* @see #getDescription()
*/
@Override
public String toString() {
return getDescription();
}
......@@ -127,6 +128,7 @@ public class BeanComponentDefinition extends BeanDefinitionHolder implements Com
* This implementations expects the other object to be of type BeanComponentDefinition
* as well, in addition to the superclass's equality requirements.
*/
@Override
public boolean equals(Object other) {
return (this == other || (other instanceof BeanComponentDefinition && super.equals(other)));
}
......
......@@ -36,6 +36,7 @@ public class BeanEntry implements ParseState.Entry {
}
@Override
public String toString() {
return "Bean '" + this.beanDefinitionName + "'";
}
......
......@@ -52,6 +52,7 @@ public class ConstructorArgumentEntry implements ParseState.Entry {
}
@Override
public String toString() {
return "Constructor-arg" + (this.index >= 0 ? " #" + this.index : "");
}
......
......@@ -93,6 +93,7 @@ public final class ParseState {
/**
* Returns a tree-style representation of the current <code>ParseState</code>.
*/
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
for (int x = 0; x < this.state.size(); x++) {
......
......@@ -114,6 +114,7 @@ public class Problem {
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("Configuration problem: ");
......
......@@ -43,6 +43,7 @@ public class PropertyEntry implements ParseState.Entry {
}
@Override
public String toString() {
return "Property '" + this.name + "'";
}
......
......@@ -36,6 +36,7 @@ public class QualifierEntry implements ParseState.Entry {
this.typeName = typeName;
}
@Override
public String toString() {
return "Qualifier '" + this.typeName + "'";
}
......
......@@ -53,6 +53,7 @@ public abstract class AbstractServiceLoaderBasedFactoryBean extends AbstractFact
return this.serviceType;
}
@Override
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = beanClassLoader;
}
......@@ -62,6 +63,7 @@ public abstract class AbstractServiceLoaderBasedFactoryBean extends AbstractFact
* Delegates to {@link #getObjectToExpose(java.util.ServiceLoader)}.
* @return the object to expose
*/
@Override
protected Object createInstance() {
Assert.notNull(getServiceType(), "Property 'serviceType' is required");
return getObjectToExpose(ServiceLoader.load(getServiceType(), this.beanClassLoader));
......
......@@ -32,6 +32,7 @@ import org.springframework.beans.factory.BeanClassLoaderAware;
*/
public class ServiceFactoryBean extends AbstractServiceLoaderBasedFactoryBean implements BeanClassLoaderAware {
@Override
protected Object getObjectToExpose(ServiceLoader serviceLoader) {
Iterator it = serviceLoader.iterator();
if (!it.hasNext()) {
......@@ -41,6 +42,7 @@ public class ServiceFactoryBean extends AbstractServiceLoaderBasedFactoryBean im
return it.next();
}
@Override
public Class getObjectType() {
return getServiceType();
}
......
......@@ -34,6 +34,7 @@ import org.springframework.beans.factory.BeanClassLoaderAware;
*/
public class ServiceListFactoryBean extends AbstractServiceLoaderBasedFactoryBean implements BeanClassLoaderAware {
@Override
protected Object getObjectToExpose(ServiceLoader serviceLoader) {
List result = new LinkedList();
Iterator it = serviceLoader.iterator();
......@@ -43,6 +44,7 @@ public class ServiceListFactoryBean extends AbstractServiceLoaderBasedFactoryBea
return result;
}
@Override
public Class getObjectType() {
return List.class;
}
......
......@@ -30,10 +30,12 @@ import org.springframework.beans.factory.BeanClassLoaderAware;
*/
public class ServiceLoaderFactoryBean extends AbstractServiceLoaderBasedFactoryBean implements BeanClassLoaderAware {
@Override
protected Object getObjectToExpose(ServiceLoader serviceLoader) {
return serviceLoader;
}
@Override
public Class getObjectType() {
return ServiceLoader.class;
}
......
......@@ -231,6 +231,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
}
@Override
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
super.copyConfigurationFrom(otherFactory);
if (otherFactory instanceof AbstractAutowireCapableBeanFactory) {
......@@ -373,6 +374,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* populates the bean instance, applies post-processors, etc.
* @see #doCreateBean
*/
@Override
protected Object createBean(final String beanName, final RootBeanDefinition mbd, final Object[] args)
throws BeanCreationException {
......@@ -515,6 +517,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
return exposedObject;
}
@Override
protected Class predictBeanType(String beanName, RootBeanDefinition mbd, Class[] typesToMatch) {
Class beanClass = null;
if (mbd.getFactoryMethodName() != null) {
......@@ -610,6 +613,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* FactoryBean. If the FactoryBean instance itself is not kept as singleton,
* it will be fully created to check the type of its exposed object.
*/
@Override
protected Class getTypeForFactoryBean(String beanName, RootBeanDefinition mbd) {
FactoryBean fb = (mbd.isSingleton() ?
getSingletonFactoryBeanForTypeCheck(beanName, mbd) :
......@@ -1425,6 +1429,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* object obtained from FactoryBeans (for example, to auto-proxy them).
* @see #applyBeanPostProcessorsAfterInitialization
*/
@Override
protected Object postProcessObjectFromFactoryBean(Object object, String beanName) {
return applyBeanPostProcessorsAfterInitialization(object, beanName);
}
......@@ -1432,6 +1437,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/**
* Overridden to clear FactoryBean instance cache as well.
*/
@Override
protected void removeSingleton(String beanName) {
super.removeSingleton(beanName);
this.factoryBeanInstanceCache.remove(beanName);
......
......@@ -918,6 +918,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* Delegates to {@link #cloneBeanDefinition()}.
* @see java.lang.Object#clone()
*/
@Override
public Object clone() {
return cloneBeanDefinition();
}
......@@ -930,6 +931,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
public abstract AbstractBeanDefinition cloneBeanDefinition();
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -969,6 +971,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
return super.equals(other);
}
@Override
public int hashCode() {
int hashCode = ObjectUtils.nullSafeHashCode(getBeanClassName());
hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.scope);
......@@ -980,6 +983,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
return hashCode;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer("class [");
sb.append(getBeanClassName()).append("]");
......
......@@ -502,6 +502,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
@Override
public String[] getAliases(String name) {
String beanName = transformedBeanName(name);
List aliases = new ArrayList();
......
......@@ -54,10 +54,12 @@ class BeanDefinitionResource extends AbstractResource {
}
@Override
public boolean exists() {
return false;
}
@Override
public boolean isReadable() {
return false;
}
......@@ -75,6 +77,7 @@ class BeanDefinitionResource extends AbstractResource {
/**
* This implementation compares the underlying BeanDefinition.
*/
@Override
public boolean equals(Object obj) {
return (obj == this ||
(obj instanceof BeanDefinitionResource &&
......@@ -84,6 +87,7 @@ class BeanDefinitionResource extends AbstractResource {
/**
* This implementation returns the hash code of the underlying BeanDefinition.
*/
@Override
public int hashCode() {
return this.beanDefinition.hashCode();
}
......
......@@ -63,6 +63,7 @@ public class CglibSubclassingInstantiationStrategy extends SimpleInstantiationSt
private static final int METHOD_REPLACER = 2;
@Override
protected Object instantiateWithMethodInjection(
RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) {
......@@ -70,6 +71,7 @@ public class CglibSubclassingInstantiationStrategy extends SimpleInstantiationSt
return new CglibSubclassCreator(beanDefinition, owner).instantiate(null, null);
}
@Override
protected Object instantiateWithMethodInjection(
RootBeanDefinition beanDefinition, String beanName, BeanFactory owner,
Constructor ctor, Object[] args) {
......@@ -133,11 +135,13 @@ public class CglibSubclassingInstantiationStrategy extends SimpleInstantiationSt
return beanDefinition;
}
@Override
public boolean equals(Object other) {
return (other.getClass().equals(getClass()) &&
((CglibIdentitySupport) other).getBeanDefinition().equals(beanDefinition));
}
@Override
public int hashCode() {
return beanDefinition.hashCode();
}
......
......@@ -139,6 +139,7 @@ public class ChildBeanDefinition extends AbstractBeanDefinition {
return this.parentName;
}
@Override
public void validate() throws BeanDefinitionValidationException {
super.validate();
if (this.parentName == null) {
......@@ -147,10 +148,12 @@ public class ChildBeanDefinition extends AbstractBeanDefinition {
}
@Override
public AbstractBeanDefinition cloneBeanDefinition() {
return new ChildBeanDefinition(this);
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -162,10 +165,12 @@ public class ChildBeanDefinition extends AbstractBeanDefinition {
return (ObjectUtils.nullSafeEquals(this.parentName, that.parentName) && super.equals(other));
}
@Override
public int hashCode() {
return ObjectUtils.nullSafeHashCode(this.parentName) * 29 + super.hashCode();
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer("Child bean with parent '");
sb.append(this.parentName).append("': ").append(super.toString());
......
......@@ -165,6 +165,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
}
@Override
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
super.copyConfigurationFrom(otherFactory);
if (otherFactory instanceof DefaultListableBeanFactory) {
......@@ -179,6 +180,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
// Implementation of ListableBeanFactory interface
//---------------------------------------------------------------------
@Override
public boolean containsBeanDefinition(String beanName) {
return this.beanDefinitionMap.containsKey(beanName);
}
......@@ -378,6 +380,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
new BeanDefinitionHolder(mbd, beanName, getAliases(beanName)), descriptor);
}
@Override
public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException {
BeanDefinition bd = (BeanDefinition) this.beanDefinitionMap.get(beanName);
if (bd == null) {
......@@ -405,6 +408,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
* if the factory's configuration has been marked as frozen.
* @see #freezeConfiguration()
*/
@Override
protected boolean isBeanEligibleForMetadataCaching(String beanName) {
return (this.configurationFrozen || super.isBeanEligibleForMetadataCaching(beanName));
}
......@@ -529,6 +533,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
/**
* Only allows alias overriding if bean definition overriding is allowed.
*/
@Override
protected boolean allowAliasOverriding() {
return this.allowBeanDefinitionOverriding;
}
......@@ -729,6 +734,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer(ObjectUtils.identityToString(this));
sb.append(": defining beans [");
......
......@@ -180,6 +180,7 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
/**
* Overridden to clear the FactoryBean object cache as well.
*/
@Override
protected void removeSingleton(String beanName) {
super.removeSingleton(beanName);
this.factoryBeanObjectCache.remove(beanName);
......
......@@ -74,14 +74,17 @@ public class GenericBeanDefinition extends AbstractBeanDefinition {
}
@Override
public AbstractBeanDefinition cloneBeanDefinition() {
return new GenericBeanDefinition(this);
}
@Override
public boolean equals(Object other) {
return (this == other || (other instanceof GenericBeanDefinition && super.equals(other)));
}
@Override
public String toString() {
return "Generic bean: " + super.toString();
}
......
......@@ -59,20 +59,24 @@ public class LookupOverride extends MethodOverride {
/**
* Match method of the given name, with no parameters.
*/
@Override
public boolean matches(Method method) {
return (method.getName().equals(getMethodName()) && method.getParameterTypes().length == 0);
}
@Override
public String toString() {
return "LookupOverride for method '" + getMethodName() + "'; will return bean '" + this.beanName + "'";
}
@Override
public boolean equals(Object other) {
return (other instanceof LookupOverride && super.equals(other) &&
ObjectUtils.nullSafeEquals(this.beanName, ((LookupOverride) other).beanName));
}
@Override
public int hashCode() {
return (29 * super.hashCode() + ObjectUtils.nullSafeHashCode(this.beanName));
}
......
......@@ -98,6 +98,7 @@ public abstract class MethodOverride implements BeanMetadataElement {
public abstract boolean matches(Method method);
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -111,6 +112,7 @@ public abstract class MethodOverride implements BeanMetadataElement {
ObjectUtils.nullSafeEquals(this.source, that.source));
}
@Override
public int hashCode() {
int hashCode = ObjectUtils.nullSafeHashCode(this.methodName);
hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.source);
......
......@@ -99,6 +99,7 @@ public class MethodOverrides {
return null;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -110,6 +111,7 @@ public class MethodOverrides {
return true;
}
@Override
public int hashCode() {
return this.overrides.hashCode();
}
......
......@@ -72,6 +72,7 @@ public class ReplaceOverride extends MethodOverride {
}
@Override
public boolean matches(Method method) {
// TODO could cache result for efficiency
if (!method.getName().equals(getMethodName())) {
......@@ -99,11 +100,13 @@ public class ReplaceOverride extends MethodOverride {
}
@Override
public String toString() {
return "Replace override for method '" + getMethodName() + "; will call bean '" +
this.methodReplacerBeanName + "'";
}
@Override
public boolean equals(Object other) {
if (!(other instanceof ReplaceOverride) || !super.equals(other)) {
return false;
......@@ -113,6 +116,7 @@ public class ReplaceOverride extends MethodOverride {
ObjectUtils.nullSafeEquals(this.typeIdentifiers, that.typeIdentifiers));
}
@Override
public int hashCode() {
int hashCode = super.hashCode();
hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.methodReplacerBeanName);
......
......@@ -244,14 +244,17 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
}
@Override
public AbstractBeanDefinition cloneBeanDefinition() {
return new RootBeanDefinition(this);
}
@Override
public boolean equals(Object other) {
return (this == other || (other instanceof RootBeanDefinition && super.equals(other)));
}
@Override
public String toString() {
return "Root bean: " + super.toString();
}
......
......@@ -123,6 +123,7 @@ public abstract class AbstractSimpleBeanDefinitionParser extends AbstractSingleB
* @param builder used to define the <code>BeanDefinition</code>
* @see #extractPropertyName(String)
*/
@Override
protected final void doParse(Element element, BeanDefinitionBuilder builder) {
NamedNodeMap attributes = element.getAttributes();
for (int x = 0; x < attributes.getLength(); x++) {
......
......@@ -56,6 +56,7 @@ public abstract class AbstractSingleBeanDefinitionParser extends AbstractBeanDef
* {@link #getBeanClass(org.w3c.dom.Element)} is <code>null</code>
* @see #doParse
*/
@Override
protected final AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition();
String parentName = getParentName(element);
......
......@@ -69,6 +69,7 @@ public class ResourceEntityResolver extends DelegatingEntityResolver {
}
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
InputSource source = super.resolveEntity(publicId, systemId);
if (source == null && systemId != null) {
......
......@@ -57,10 +57,12 @@ public class UtilNamespaceHandler extends NamespaceHandlerSupport {
private static class ConstantBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser {
@Override
protected Class getBeanClass(Element element) {
return FieldRetrievingFactoryBean.class;
}
@Override
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) {
String id = super.resolveId(element, definition, parserContext);
if (!StringUtils.hasText(id)) {
......@@ -73,10 +75,12 @@ public class UtilNamespaceHandler extends NamespaceHandlerSupport {
private static class PropertyPathBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
@Override
protected Class getBeanClass(Element element) {
return PropertyPathFactoryBean.class;
}
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
String path = element.getAttribute("path");
if (!StringUtils.hasText(path)) {
......@@ -95,6 +99,7 @@ public class UtilNamespaceHandler extends NamespaceHandlerSupport {
builder.addPropertyValue("propertyPath", propertyPath);
}
@Override
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) {
String id = super.resolveId(element, definition, parserContext);
if (!StringUtils.hasText(id)) {
......@@ -107,10 +112,12 @@ public class UtilNamespaceHandler extends NamespaceHandlerSupport {
private static class ListBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
@Override
protected Class getBeanClass(Element element) {
return ListFactoryBean.class;
}
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
String listClass = element.getAttribute("list-class");
List parsedList = parserContext.getDelegate().parseListElement(element, builder.getRawBeanDefinition());
......@@ -128,10 +135,12 @@ public class UtilNamespaceHandler extends NamespaceHandlerSupport {
private static class SetBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
@Override
protected Class getBeanClass(Element element) {
return SetFactoryBean.class;
}
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
String setClass = element.getAttribute("set-class");
Set parsedSet = parserContext.getDelegate().parseSetElement(element, builder.getRawBeanDefinition());
......@@ -149,10 +158,12 @@ public class UtilNamespaceHandler extends NamespaceHandlerSupport {
private static class MapBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
@Override
protected Class getBeanClass(Element element) {
return MapFactoryBean.class;
}
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
String mapClass = element.getAttribute("map-class");
Map parsedMap = parserContext.getDelegate().parseMapElement(element, builder.getRawBeanDefinition());
......@@ -170,14 +181,17 @@ public class UtilNamespaceHandler extends NamespaceHandlerSupport {
private static class PropertiesBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser {
@Override
protected Class getBeanClass(Element element) {
return PropertiesFactoryBean.class;
}
@Override
protected boolean isEligibleAttribute(String attributeName) {
return super.isEligibleAttribute(attributeName) && !SCOPE_ATTRIBUTE.equals(attributeName);
}
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
super.doParse(element, parserContext, builder);
Properties parsedProps = parserContext.getDelegate().parsePropsElement(element);
......
......@@ -28,10 +28,12 @@ import java.beans.PropertyEditorSupport;
*/
public class ByteArrayPropertyEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) {
setValue(text != null ? text.getBytes() : null);
}
@Override
public String getAsText() {
byte[] value = (byte[]) getValue();
return (value != null ? new String(value) : "");
......
......@@ -28,10 +28,12 @@ import java.beans.PropertyEditorSupport;
*/
public class CharArrayPropertyEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) {
setValue(text != null ? text.toCharArray() : null);
}
@Override
public String getAsText() {
char[] value = (char[]) getValue();
return (value != null ? new String(value) : "");
......
......@@ -69,6 +69,7 @@ public class CharacterEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (this.allowEmpty && !StringUtils.hasLength(text)) {
// Treat empty String as null value.
......@@ -89,6 +90,7 @@ public class CharacterEditor extends PropertyEditorSupport {
}
}
@Override
public String getAsText() {
Object value = getValue();
return (value != null ? value.toString() : "");
......
......@@ -33,6 +33,7 @@ import org.springframework.util.StringUtils;
*/
public class CharsetEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (StringUtils.hasText(text)) {
setValue(Charset.forName(text));
......@@ -42,6 +43,7 @@ public class CharsetEditor extends PropertyEditorSupport {
}
}
@Override
public String getAsText() {
Charset value = (Charset) getValue();
return (value != null ? value.name() : "");
......
......@@ -57,6 +57,7 @@ public class ClassArrayEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (StringUtils.hasText(text)) {
String[] classNames = StringUtils.commaDelimitedListToStringArray(text);
......@@ -72,6 +73,7 @@ public class ClassArrayEditor extends PropertyEditorSupport {
}
}
@Override
public String getAsText() {
Class[] classes = (Class[]) getValue();
if (classes == null || classes.length == 0) {
......
......@@ -58,6 +58,7 @@ public class ClassEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (StringUtils.hasText(text)) {
setValue(ClassUtils.resolveClassName(text.trim(), this.classLoader));
......@@ -67,6 +68,7 @@ public class ClassEditor extends PropertyEditorSupport {
}
}
@Override
public String getAsText() {
Class clazz = (Class) getValue();
if (clazz != null) {
......
......@@ -97,6 +97,7 @@ public class CustomBooleanEditor extends PropertyEditorSupport {
this.allowEmpty = allowEmpty;
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
String input = (text != null ? text.trim() : null);
if (this.allowEmpty && !StringUtils.hasLength(input)) {
......@@ -124,6 +125,7 @@ public class CustomBooleanEditor extends PropertyEditorSupport {
}
}
@Override
public String getAsText() {
if (Boolean.TRUE.equals(getValue())) {
return (this.trueString != null ? this.trueString : VALUE_TRUE);
......
......@@ -96,6 +96,7 @@ public class CustomCollectionEditor extends PropertyEditorSupport {
/**
* Convert the given text value to a Collection with a single element.
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
setValue(text);
}
......@@ -103,6 +104,7 @@ public class CustomCollectionEditor extends PropertyEditorSupport {
/**
* Convert the given value to a Collection of the target type.
*/
@Override
public void setValue(Object value) {
if (value == null && this.nullAsEmptyCollection) {
super.setValue(createCollection(this.collectionType, 0));
......@@ -199,6 +201,7 @@ public class CustomCollectionEditor extends PropertyEditorSupport {
* This implementation returns <code>null</code> to indicate that
* there is no appropriate text representation.
*/
@Override
public String getAsText() {
return null;
}
......
......@@ -92,6 +92,7 @@ public class CustomDateEditor extends PropertyEditorSupport {
/**
* Parse the Date from the given text, using the specified DateFormat.
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (this.allowEmpty && !StringUtils.hasText(text)) {
// Treat empty String as null value.
......@@ -117,6 +118,7 @@ public class CustomDateEditor extends PropertyEditorSupport {
/**
* Format the Date as String, using the specified DateFormat.
*/
@Override
public String getAsText() {
Date value = (Date) getValue();
return (value != null ? this.dateFormat.format(value) : "");
......
......@@ -86,6 +86,7 @@ public class CustomMapEditor extends PropertyEditorSupport {
/**
* Convert the given text value to a Map with a single element.
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
setValue(text);
}
......@@ -93,6 +94,7 @@ public class CustomMapEditor extends PropertyEditorSupport {
/**
* Convert the given value to a Map of the target type.
*/
@Override
public void setValue(Object value) {
if (value == null && this.nullAsEmptyMap) {
super.setValue(createMap(this.mapType, 0));
......@@ -192,6 +194,7 @@ public class CustomMapEditor extends PropertyEditorSupport {
* This implementation returns <code>null</code> to indicate that
* there is no appropriate text representation.
*/
@Override
public String getAsText() {
return null;
}
......
......@@ -100,6 +100,7 @@ public class CustomNumberEditor extends PropertyEditorSupport {
/**
* Parse the Number from the given text, using the specified NumberFormat.
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (this.allowEmpty && !StringUtils.hasText(text)) {
// Treat empty String as null value.
......@@ -118,6 +119,7 @@ public class CustomNumberEditor extends PropertyEditorSupport {
/**
* Coerce a Number value into the required target class, if necessary.
*/
@Override
public void setValue(Object value) {
if (value instanceof Number) {
super.setValue(NumberUtils.convertNumberToTargetClass((Number) value, this.numberClass));
......@@ -130,6 +132,7 @@ public class CustomNumberEditor extends PropertyEditorSupport {
/**
* Format the Number as String, using the specified NumberFormat.
*/
@Override
public String getAsText() {
Object value = getValue();
if (value == null) {
......
......@@ -77,6 +77,7 @@ public class FileEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
// Check whether we got an absolute file path without "file:" prefix.
// For backwards compatibility, we'll consider those as straight file path.
......@@ -108,6 +109,7 @@ public class FileEditor extends PropertyEditorSupport {
}
}
@Override
public String getAsText() {
File value = (File) getValue();
return (value != null ? value.getPath() : "");
......
......@@ -66,6 +66,7 @@ public class InputStreamEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
this.resourceEditor.setAsText(text);
Resource resource = (Resource) this.resourceEditor.getValue();
......@@ -82,6 +83,7 @@ public class InputStreamEditor extends PropertyEditorSupport {
* This implementation returns <code>null</code> to indicate that
* there is no appropriate text representation.
*/
@Override
public String getAsText() {
return null;
}
......
......@@ -34,10 +34,12 @@ import org.springframework.util.StringUtils;
*/
public class LocaleEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) {
setValue(StringUtils.parseLocaleString(text));
}
@Override
public String getAsText() {
Object value = getValue();
return (value != null ? value.toString() : "");
......
......@@ -55,10 +55,12 @@ public class PatternEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) {
setValue(text != null ? Pattern.compile(text, this.flags) : null);
}
@Override
public String getAsText() {
Pattern value = (Pattern) getValue();
return (value != null ? value.pattern() : "");
......
......@@ -50,6 +50,7 @@ public class PropertiesEditor extends PropertyEditorSupport {
* properties content.
* @param text the text to be so converted
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
Properties props = new Properties();
if (text != null) {
......@@ -69,6 +70,7 @@ public class PropertiesEditor extends PropertyEditorSupport {
/**
* Take {@link Properties} as-is; convert {@link Map} into <code>Properties</code>.
*/
@Override
public void setValue(Object value) {
if (!(value instanceof Properties) && value instanceof Map) {
Properties props = new Properties();
......
......@@ -79,6 +79,7 @@ public class ResourceBundleEditor extends PropertyEditorSupport {
public static final String BASE_NAME_SEPARATOR = "_";
@Override
public void setAsText(String text) throws IllegalArgumentException {
Assert.hasText(text, "'text' must not be empty");
ResourceBundle bundle;
......
......@@ -90,6 +90,7 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
String[] array = StringUtils.delimitedListToStringArray(text, this.separator, this.charsToDelete);
if (this.emptyArrayAsNull && array.length == 0) {
......@@ -100,6 +101,7 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport {
}
}
@Override
public String getAsText() {
return StringUtils.arrayToDelimitedString(ObjectUtils.toObjectArray(getValue()), this.separator);
}
......
......@@ -61,6 +61,7 @@ public class StringTrimmerEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) {
if (text == null) {
setValue(null);
......@@ -79,6 +80,7 @@ public class StringTrimmerEditor extends PropertyEditorSupport {
}
}
@Override
public String getAsText() {
Object value = getValue();
return (value != null ? value.toString() : "");
......
......@@ -67,6 +67,7 @@ public class URIEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (StringUtils.hasText(text)) {
String uri = text.trim();
......@@ -111,6 +112,7 @@ public class URIEditor extends PropertyEditorSupport {
}
@Override
public String getAsText() {
URI value = (URI) getValue();
return (value != null ? value.toString() : "");
......
......@@ -66,6 +66,7 @@ public class URLEditor extends PropertyEditorSupport {
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
this.resourceEditor.setAsText(text);
Resource resource = (Resource) this.resourceEditor.getValue();
......@@ -77,6 +78,7 @@ public class URLEditor extends PropertyEditorSupport {
}
}
@Override
public String getAsText() {
URL value = (URL) getValue();
return (value != null ? value.toExternalForm() : "");
......
......@@ -106,6 +106,7 @@ public class ArgumentConvertingMethodInvoker extends MethodInvoker {
* This implementation looks for a method with matching parameter types.
* @see #doFindMatchingMethod
*/
@Override
protected Method findMatchingMethod() {
Method matchingMethod = super.findMatchingMethod();
// Second pass: look for method where arguments can be converted to parameter types.
......
......@@ -149,6 +149,7 @@ public class MutableSortDefinition implements SortDefinition, Serializable {
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
......@@ -161,6 +162,7 @@ public class MutableSortDefinition implements SortDefinition, Serializable {
isAscending() == otherSd.isAscending() && isIgnoreCase() == otherSd.isIgnoreCase());
}
@Override
public int hashCode() {
int hashCode = getProperty().hashCode();
hashCode = 29 * hashCode + (isIgnoreCase() ? 1 : 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册