Skip to content

Commit b56e877

Browse files
committed
fix: equals(@nullable Object)
String found: org.springframework.cglib.core.EmitUtils/KeyFactory
1 parent 5b6c231 commit b56e877

File tree

31 files changed

+75
-39
lines changed

31 files changed

+75
-39
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ public Advice getAdvice() {
731731
}
732732

733733
@Override
734-
public boolean equals(Object other) {
734+
public boolean equals(@Nullable Object other) {
735735
return (this == other || (other instanceof AdvisorKeyEntry that &&
736736
this.adviceType == that.adviceType &&
737737
ObjectUtils.nullSafeEquals(this.classFilterKey, that.classFilterKey) &&

spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public boolean matches(Class<?> clazz) {
198198
}
199199

200200
@Override
201-
public boolean equals(Object other) {
201+
public boolean equals(@Nullable Object other) {
202202
return (this == other || (other instanceof NegateClassFilter that &&
203203
this.original.equals(that.original)));
204204
}

spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ public boolean matches(Method method, Class<?> targetClass, @Nullable Object...
378378
}
379379

380380
@Override
381-
public boolean equals(Object other) {
381+
public boolean equals(@Nullable Object other) {
382382
return (this == other || (other instanceof NegateMethodMatcher that &&
383383
this.original.equals(that.original)));
384384
}

spring-context/src/main/java/org/springframework/scheduling/support/BitsCronField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ private void clearBit(int index) {
247247

248248

249249
@Override
250-
public boolean equals(Object other) {
250+
public boolean equals(@Nullable Object other) {
251251
return (this == other || (other instanceof BitsCronField that &&
252252
type() == that.type() && this.bits == that.bits));
253253
}

spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public interface Named {
180180
String getName();
181181

182182
@Override
183-
boolean equals(Object other);
183+
boolean equals(@Nullable Object other);
184184

185185
@Override
186186
int hashCode();

spring-core/src/main/java/org/springframework/cglib/beans/BeanMap.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import java.util.Objects;
2828
import java.util.Set;
2929

30+
import org.jspecify.annotations.Nullable;
31+
3032
import org.springframework.asm.ClassVisitor;
3133
import org.springframework.cglib.core.AbstractClassGenerator;
3234
import org.springframework.cglib.core.KeyFactory;
@@ -276,7 +278,7 @@ public void putAll(Map t) {
276278
}
277279

278280
@Override
279-
public boolean equals(Object o) {
281+
public boolean equals(@Nullable Object o) {
280282
if (o == null || !(o instanceof Map other)) {
281283
return false;
282284
}

spring-core/src/main/java/org/springframework/cglib/core/ClassEmitter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import java.util.HashMap;
1919
import java.util.Map;
2020

21+
import org.jspecify.annotations.Nullable;
22+
2123
import org.springframework.asm.ClassVisitor;
2224
import org.springframework.asm.FieldVisitor;
2325
import org.springframework.asm.MethodVisitor;
@@ -229,7 +231,7 @@ public FieldInfo(int access, String name, Type type, Object value) {
229231
}
230232

231233
@Override
232-
public boolean equals(Object o) {
234+
public boolean equals(@Nullable Object o) {
233235
if (o == null) {
234236
return false;
235237
}

spring-core/src/main/java/org/springframework/cglib/core/ClassInfo.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.cglib.core;
1818

19+
import org.jspecify.annotations.Nullable;
20+
1921
import org.springframework.asm.Type;
2022

2123
abstract public class ClassInfo {
@@ -29,7 +31,7 @@ protected ClassInfo() {
2931
abstract public int getModifiers();
3032

3133
@Override
32-
public boolean equals(Object o) {
34+
public boolean equals(@Nullable Object o) {
3335
if (o == null) {
3436
return false;
3537
}

spring-core/src/main/java/org/springframework/cglib/core/DefaultNamingPolicy.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.cglib.core;
1818

19+
import org.jspecify.annotations.Nullable;
20+
1921
/**
2022
* The default policy used by {@link AbstractClassGenerator}.
2123
* Generates names such as
@@ -68,7 +70,7 @@ public int hashCode() {
6870
}
6971

7072
@Override
71-
public boolean equals(Object o) {
73+
public boolean equals(@Nullable Object o) {
7274
return (o instanceof DefaultNamingPolicy defaultNamingPolicy) &&
7375
defaultNamingPolicy.getTag().equals(getTag());
7476
}

spring-core/src/main/java/org/springframework/cglib/core/GeneratorStrategy.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package org.springframework.cglib.core;
1717

18+
import org.jspecify.annotations.Nullable;
19+
1820
/**
1921
* The <code>GeneratorStrategy</code> is responsible for taking a
2022
* {@link ClassGenerator} and producing a byte array containing the
@@ -41,5 +43,5 @@ public interface GeneratorStrategy {
4143
* to avoid generating too many classes.
4244
*/
4345
@Override
44-
boolean equals(Object o);
46+
boolean equals(@Nullable Object o);
4547
}

0 commit comments

Comments
 (0)