Consistent equals/hashCode style (and related polishing)

This commit is contained in:
Juergen Hoeller
2023-07-19 00:35:19 +02:00
parent bbcc788f60
commit 2f33e77ab4
98 changed files with 413 additions and 835 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.
@@ -65,13 +65,8 @@ public class MatchAlwaysTransactionAttributeSource implements TransactionAttribu
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof MatchAlwaysTransactionAttributeSource otherTas)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.transactionAttribute, otherTas.transactionAttribute);
return (this == other || (other instanceof MatchAlwaysTransactionAttributeSource that &&
ObjectUtils.nullSafeEquals(this.transactionAttribute, that.transactionAttribute)));
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 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.
@@ -180,13 +180,8 @@ public class RollbackRuleAttribute implements Serializable{
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof RollbackRuleAttribute rhs)) {
return false;
}
return this.exceptionPattern.equals(rhs.exceptionPattern);
return (this == other || (other instanceof RollbackRuleAttribute that &&
this.exceptionPattern.equals(that.exceptionPattern)));
}
@Override