Consistent equals implementations in AOP support classes

This commit is contained in:
Juergen Hoeller
2023-06-08 17:36:39 +02:00
parent 6931106c5e
commit c16f582ed8
12 changed files with 52 additions and 119 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -191,14 +191,9 @@ public class AnnotationTransactionAttributeSource extends AbstractFallbackTransa
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof AnnotationTransactionAttributeSource otherTas)) {
return false;
}
return (this.annotationParsers.equals(otherTas.annotationParsers) &&
this.publicMethodsOnly == otherTas.publicMethodsOnly);
return (this == other || (other instanceof AnnotationTransactionAttributeSource otherTas &&
this.annotationParsers.equals(otherTas.annotationParsers) &&
this.publicMethodsOnly == otherTas.publicMethodsOnly));
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -239,13 +239,8 @@ public class MethodMapTransactionAttributeSource
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof MethodMapTransactionAttributeSource otherTas)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.methodMap, otherTas.methodMap);
return (this == other || (other instanceof MethodMapTransactionAttributeSource otherTas &&
ObjectUtils.nullSafeEquals(this.methodMap, otherTas.methodMap)));
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -164,13 +164,8 @@ public class NameMatchTransactionAttributeSource
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof NameMatchTransactionAttributeSource otherTas)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.nameMap, otherTas.nameMap);
return (this == other || (other instanceof NameMatchTransactionAttributeSource otherTas &&
ObjectUtils.nullSafeEquals(this.nameMap, otherTas.nameMap)));
}
@Override