Skip to content

Commit

Permalink
Annotate Object#equals parameter with @nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Jun 6, 2019
1 parent 33becd8 commit 098ac0b
Show file tree
Hide file tree
Showing 158 changed files with 222 additions and 176 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ public boolean matches(Method method, Class<?> targetClass) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ else if (shadowMatch.maybeMatches() && fallbackExpression != null) {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public String getAspectName() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ public MethodCacheKey(Method method) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof MethodCacheKey &&
this.method == ((MethodCacheKey) other).method));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ private Callback[] getCallbacks(Class<?> rootClass) throws Exception {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof CglibAopProxy &&
AopProxyUtils.equalsInProxy(this.advised, ((CglibAopProxy) other).advised)));
}
Expand Down Expand Up @@ -703,7 +703,7 @@ public Object intercept(Object proxy, Method method, Object[] args, MethodProxy
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other ||
(other instanceof DynamicAdvisedInterceptor &&
this.advised.equals(((DynamicAdvisedInterceptor) other).advised)));
Expand Down Expand Up @@ -899,7 +899,7 @@ public int accept(Method method) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public boolean isPerInstance() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.lang.reflect.Method;
import java.util.Arrays;

import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ObjectUtils;
Expand Down Expand Up @@ -195,7 +196,7 @@ protected boolean matchesPattern(String signatureString) {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.Serializable;

import org.springframework.aop.ClassFilter;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;

Expand Down Expand Up @@ -106,7 +107,7 @@ public boolean matches(Class<?> clazz) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof UnionClassFilter &&
ObjectUtils.nullSafeEquals(this.filters, ((UnionClassFilter) other).filters)));
}
Expand Down Expand Up @@ -141,7 +142,7 @@ public boolean matches(Class<?> clazz) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof IntersectionClassFilter &&
ObjectUtils.nullSafeEquals(this.filters, ((IntersectionClassFilter) other).filters)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.aop.ClassFilter;
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

/**
Expand Down Expand Up @@ -180,7 +181,7 @@ public MethodMatcher getMethodMatcher() {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public MethodMatcher getMethodMatcher() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public boolean matches(Class<?> clazz) {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.aop.ClassFilter;
import org.springframework.aop.IntroductionAwareMethodMatcher;
import org.springframework.aop.MethodMatcher;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

/**
Expand Down Expand Up @@ -140,7 +141,7 @@ public boolean matches(Method method, Class<?> targetClass, Object... args) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down Expand Up @@ -207,7 +208,7 @@ protected boolean matchesClass2(Class<?> targetClass) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down Expand Up @@ -296,7 +297,7 @@ public boolean matches(Method method, Class<?> targetClass, Object... args) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.Arrays;
import java.util.List;

import org.springframework.lang.Nullable;
import org.springframework.util.PatternMatchUtils;

/**
Expand Down Expand Up @@ -98,7 +99,7 @@ protected boolean isMatch(String methodName, String mappedName) {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof NameMatchMethodPointcut &&
this.mappedNames.equals(((NameMatchMethodPointcut) other).mappedNames)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.springframework.aop.ClassFilter;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

/**
Expand Down Expand Up @@ -67,7 +68,7 @@ public boolean matches(Class<?> clazz) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public MethodMatcher getMethodMatcher() {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.springframework.aop.support.AopUtils;
import org.springframework.aop.support.StaticMethodMatcher;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

/**
Expand Down Expand Up @@ -86,7 +87,7 @@ private boolean matchesMethod(Method method) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Object getSource() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public void setPropertyEditorClass(@Nullable Class<?> propertyEditorClass) {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof PropertyDescriptor &&
PropertyDescriptorUtils.equals(this, (PropertyDescriptor) other)));
}
Expand Down Expand Up @@ -491,7 +491,7 @@ public void setPropertyEditorClass(@Nullable Class<?> propertyEditorClass) {
* See java.beans.IndexedPropertyDescriptor#equals(java.lang.Object)
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public Class<?> getPropertyEditorClass() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public boolean isConverted() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof MutablePropertyValues &&
this.propertyValueList.equals(((MutablePropertyValues) other).propertyValueList)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public synchronized Object getConvertedValue() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public AnnotatedElement getAnnotatedElement() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public void invoke(Object target) throws Throwable {
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ protected Object getResourceToInject(Object target, @Nullable String requestingB
}

@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public String toString() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ else if (this.scope != null) {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public void clear() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ else if (type instanceof ParameterizedType) {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Object getSource() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public Object getSource() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public boolean isDynamic() {


@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public String toString() {
* as well, in addition to the superclass's equality requirements.
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof BeanComponentDefinition && super.equals(other)));
}

Expand Down
Loading

0 comments on commit 098ac0b

Please sign in to comment.