Skip to content

Commit

Permalink
Replace 'that' with 'other'
Browse files Browse the repository at this point in the history
Update code to use "other" rather than "that" for equals and compareTo
methods.
  • Loading branch information
philwebb committed May 20, 2020
1 parent e13f68d commit f23a44f
Show file tree
Hide file tree
Showing 41 changed files with 139 additions and 139 deletions.
Expand Up @@ -761,11 +761,11 @@ public boolean equals(Object o) {
if (!(o instanceof StoreConversions)) {
return false;
}
StoreConversions that = (StoreConversions) o;
if (!ObjectUtils.nullSafeEquals(this.storeTypeHolder, that.storeTypeHolder)) {
StoreConversions other = (StoreConversions) o;
if (!ObjectUtils.nullSafeEquals(this.storeTypeHolder, other.storeTypeHolder)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.storeConverters, that.storeConverters);
return ObjectUtils.nullSafeEquals(this.storeConverters, other.storeConverters);
}

@Override
Expand Down
Expand Up @@ -142,11 +142,11 @@ public boolean equals(Object o) {
if (!(o instanceof ConfigurableGenericConverter)) {
return false;
}
ConfigurableGenericConverter<?, ?> that = (ConfigurableGenericConverter<?, ?>) o;
if (!ObjectUtils.nullSafeEquals(this.convertiblePair, that.convertiblePair)) {
ConfigurableGenericConverter<?, ?> other = (ConfigurableGenericConverter<?, ?>) o;
if (!ObjectUtils.nullSafeEquals(this.convertiblePair, other.convertiblePair)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.function, that.function);
return ObjectUtils.nullSafeEquals(this.function, other.function);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/springframework/data/domain/Chunk.java
Expand Up @@ -136,9 +136,9 @@ public boolean equals(Object obj) {
if (!(obj instanceof Chunk<?>)) {
return false;
}
Chunk<?> that = (Chunk<?>) obj;
boolean contentEqual = this.content.equals(that.content);
boolean pageableEqual = this.pageable.equals(that.pageable);
Chunk<?> other = (Chunk<?>) obj;
boolean contentEqual = this.content.equals(other.content);
boolean pageableEqual = this.pageable.equals(other.pageable);
return contentEqual && pageableEqual;
}

Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/springframework/data/domain/ExampleMatcher.java
Expand Up @@ -425,14 +425,14 @@ public boolean equals(Object o) {
if (!(o instanceof GenericPropertyMatcher)) {
return false;
}
GenericPropertyMatcher that = (GenericPropertyMatcher) o;
if (this.stringMatcher != that.stringMatcher) {
GenericPropertyMatcher other = (GenericPropertyMatcher) o;
if (this.stringMatcher != other.stringMatcher) {
return false;
}
if (!ObjectUtils.nullSafeEquals(this.ignoreCase, that.ignoreCase)) {
if (!ObjectUtils.nullSafeEquals(this.ignoreCase, other.ignoreCase)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.valueTransformer, that.valueTransformer);
return ObjectUtils.nullSafeEquals(this.valueTransformer, other.valueTransformer);
}

@Override
Expand Down Expand Up @@ -699,17 +699,17 @@ public boolean equals(Object o) {
if (!(o instanceof PropertySpecifier)) {
return false;
}
PropertySpecifier that = (PropertySpecifier) o;
if (!ObjectUtils.nullSafeEquals(this.path, that.path)) {
PropertySpecifier other = (PropertySpecifier) o;
if (!ObjectUtils.nullSafeEquals(this.path, other.path)) {
return false;
}
if (this.stringMatcher != that.stringMatcher) {
if (this.stringMatcher != other.stringMatcher) {
return false;
}
if (!ObjectUtils.nullSafeEquals(this.ignoreCase, that.ignoreCase)) {
if (!ObjectUtils.nullSafeEquals(this.ignoreCase, other.ignoreCase)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.valueTransformer, that.valueTransformer);
return ObjectUtils.nullSafeEquals(this.valueTransformer, other.valueTransformer);
}

@Override
Expand Down Expand Up @@ -772,8 +772,8 @@ public boolean equals(Object o) {
if (!(o instanceof PropertySpecifiers)) {
return false;
}
PropertySpecifiers that = (PropertySpecifiers) o;
return ObjectUtils.nullSafeEquals(this.propertySpecifiers, that.propertySpecifiers);
PropertySpecifiers other = (PropertySpecifiers) o;
return ObjectUtils.nullSafeEquals(this.propertySpecifiers, other.propertySpecifiers);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/springframework/data/domain/PageImpl.java
Expand Up @@ -100,8 +100,8 @@ public boolean equals(@Nullable Object obj) {
if (!(obj instanceof PageImpl<?>)) {
return false;
}
PageImpl<?> that = (PageImpl<?>) obj;
return this.total == that.total && super.equals(obj);
PageImpl<?> other = (PageImpl<?>) obj;
return this.total == other.total && super.equals(obj);
}

@Override
Expand Down
Expand Up @@ -104,8 +104,8 @@ public boolean equals(@Nullable Object obj) {
if (!(obj instanceof PageRequest)) {
return false;
}
PageRequest that = (PageRequest) obj;
return super.equals(that) && this.sort.equals(that.sort);
PageRequest other = (PageRequest) obj;
return super.equals(other) && this.sort.equals(other.sort);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/springframework/data/domain/SliceImpl.java
Expand Up @@ -84,8 +84,8 @@ public boolean equals(@Nullable Object obj) {
if (!(obj instanceof SliceImpl<?>)) {
return false;
}
SliceImpl<?> that = (SliceImpl<?>) obj;
return this.hasNext == that.hasNext && super.equals(obj);
SliceImpl<?> other = (SliceImpl<?>) obj;
return this.hasNext == other.hasNext && super.equals(obj);
}

@Override
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/springframework/data/domain/Sort.java
Expand Up @@ -199,8 +199,8 @@ public boolean equals(@Nullable Object obj) {
if (!(obj instanceof Sort)) {
return false;
}
Sort that = (Sort) obj;
return this.orders.equals(that.orders);
Sort other = (Sort) obj;
return this.orders.equals(other.orders);
}

@Override
Expand Down Expand Up @@ -550,9 +550,9 @@ public boolean equals(@Nullable Object obj) {
if (!(obj instanceof Order)) {
return false;
}
Order that = (Order) obj;
return this.direction.equals(that.direction) && this.property.equals(that.property)
&& this.ignoreCase == that.ignoreCase && this.nullHandling.equals(that.nullHandling);
Order other = (Order) obj;
return this.direction.equals(other.direction) && this.property.equals(other.property)
&& this.ignoreCase == other.ignoreCase && this.nullHandling.equals(other.nullHandling);
}

@Override
Expand Down
Expand Up @@ -56,11 +56,11 @@ public boolean equals(Object o) {
if (!(o instanceof TypedExample)) {
return false;
}
TypedExample<?> that = (TypedExample<?>) o;
if (!ObjectUtils.nullSafeEquals(this.probe, that.probe)) {
TypedExample<?> other = (TypedExample<?>) o;
if (!ObjectUtils.nullSafeEquals(this.probe, other.probe)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.matcher, that.matcher);
return ObjectUtils.nullSafeEquals(this.matcher, other.matcher);
}

@Override
Expand Down
Expand Up @@ -182,23 +182,23 @@ public boolean equals(Object o) {
if (!(o instanceof TypedExampleMatcher)) {
return false;
}
TypedExampleMatcher that = (TypedExampleMatcher) o;
if (this.defaultIgnoreCase != that.defaultIgnoreCase) {
TypedExampleMatcher other = (TypedExampleMatcher) o;
if (this.defaultIgnoreCase != other.defaultIgnoreCase) {
return false;
}
if (this.nullHandler != that.nullHandler) {
if (this.nullHandler != other.nullHandler) {
return false;
}
if (this.defaultStringMatcher != that.defaultStringMatcher) {
if (this.defaultStringMatcher != other.defaultStringMatcher) {
return false;
}
if (!ObjectUtils.nullSafeEquals(this.propertySpecifiers, that.propertySpecifiers)) {
if (!ObjectUtils.nullSafeEquals(this.propertySpecifiers, other.propertySpecifiers)) {
return false;
}
if (!ObjectUtils.nullSafeEquals(this.ignoredPaths, that.ignoredPaths)) {
if (!ObjectUtils.nullSafeEquals(this.ignoredPaths, other.ignoredPaths)) {
return false;
}
return this.mode == that.mode;
return this.mode == other.mode;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/springframework/data/geo/Box.java
Expand Up @@ -96,8 +96,8 @@ public boolean equals(@Nullable Object obj) {
if (!(obj instanceof Box)) {
return false;
}
Box that = (Box) obj;
return this.first.equals(that.first) && this.second.equals(that.second);
Box other = (Box) obj;
return this.first.equals(other.first) && this.second.equals(other.second);
}

}
6 changes: 3 additions & 3 deletions src/main/java/org/springframework/data/geo/Distance.java
Expand Up @@ -143,11 +143,11 @@ public Distance in(Metric metric) {
}

@Override
public int compareTo(@Nullable Distance that) {
if (that == null) {
public int compareTo(@Nullable Distance other) {
if (other == null) {
return 1;
}
double difference = this.getNormalizedValue() - that.getNormalizedValue();
double difference = this.getNormalizedValue() - other.getNormalizedValue();
return difference == 0 ? 0 : difference > 0 ? 1 : -1;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/springframework/data/geo/GeoPage.java
Expand Up @@ -67,8 +67,8 @@ public boolean equals(@Nullable Object obj) {
if (!(obj instanceof GeoPage)) {
return false;
}
GeoPage<?> that = (GeoPage<?>) obj;
return super.equals(obj) && ObjectUtils.nullSafeEquals(this.averageDistance, that.averageDistance);
GeoPage<?> other = (GeoPage<?>) obj;
return super.equals(obj) && ObjectUtils.nullSafeEquals(this.averageDistance, other.averageDistance);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/springframework/data/geo/GeoResults.java
Expand Up @@ -104,11 +104,11 @@ public boolean equals(Object o) {
if (!(o instanceof GeoResults)) {
return false;
}
GeoResults<?> that = (GeoResults<?>) o;
if (!ObjectUtils.nullSafeEquals(this.results, that.results)) {
GeoResults<?> other = (GeoResults<?>) o;
if (!ObjectUtils.nullSafeEquals(this.results, other.results)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.averageDistance, that.averageDistance);
return ObjectUtils.nullSafeEquals(this.averageDistance, other.averageDistance);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/springframework/data/geo/Polygon.java
Expand Up @@ -93,8 +93,8 @@ public boolean equals(Object o) {
if (!(o instanceof Polygon)) {
return false;
}
Polygon that = (Polygon) o;
return ObjectUtils.nullSafeEquals(this.points, that.points);
Polygon other = (Polygon) o;
return ObjectUtils.nullSafeEquals(this.points, other.points);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/springframework/data/history/Revision.java
Expand Up @@ -92,11 +92,11 @@ public Instant getRequiredRevisionInstant() {
}

@Override
public int compareTo(@Nullable Revision<N, ?> that) {
if (that == null) {
public int compareTo(@Nullable Revision<N, ?> other) {
if (other == null) {
return 1;
}
return mapIfAllPresent(getRevisionNumber(), that.getRevisionNumber(), Comparable::compareTo).orElse(-1);
return mapIfAllPresent(getRevisionNumber(), other.getRevisionNumber(), Comparable::compareTo).orElse(-1);
}

@Override
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/springframework/data/mapping/PropertyPath.java
Expand Up @@ -242,23 +242,23 @@ public boolean equals(Object o) {
if (!(o instanceof PropertyPath)) {
return false;
}
PropertyPath that = (PropertyPath) o;
if (this.isCollection != that.isCollection) {
PropertyPath other = (PropertyPath) o;
if (this.isCollection != other.isCollection) {
return false;
}
if (!ObjectUtils.nullSafeEquals(this.owningType, that.owningType)) {
if (!ObjectUtils.nullSafeEquals(this.owningType, other.owningType)) {
return false;
}
if (!ObjectUtils.nullSafeEquals(this.name, that.name)) {
if (!ObjectUtils.nullSafeEquals(this.name, other.name)) {
return false;
}
if (!ObjectUtils.nullSafeEquals(this.typeInformation, that.typeInformation)) {
if (!ObjectUtils.nullSafeEquals(this.typeInformation, other.typeInformation)) {
return false;
}
if (!ObjectUtils.nullSafeEquals(this.actualTypeInformation, that.actualTypeInformation)) {
if (!ObjectUtils.nullSafeEquals(this.actualTypeInformation, other.actualTypeInformation)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.next, that.next);
return ObjectUtils.nullSafeEquals(this.next, other.next);
}

@Override
Expand Down
Expand Up @@ -191,8 +191,8 @@ public boolean equals(Object o) {
if (!(o instanceof DefaultPersistentPropertyPath)) {
return false;
}
DefaultPersistentPropertyPath<?> that = (DefaultPersistentPropertyPath<?>) o;
return ObjectUtils.nullSafeEquals(this.properties, that.properties);
DefaultPersistentPropertyPath<?> other = (DefaultPersistentPropertyPath<?>) o;
return ObjectUtils.nullSafeEquals(this.properties, other.properties);
}

@Override
Expand Down
Expand Up @@ -264,11 +264,11 @@ public boolean equals(Object o) {
if (!(o instanceof TypeAndPath)) {
return false;
}
TypeAndPath that = (TypeAndPath) o;
if (!ObjectUtils.nullSafeEquals(this.type, that.type)) {
TypeAndPath other = (TypeAndPath) o;
if (!ObjectUtils.nullSafeEquals(this.type, other.type)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.path, that.path);
return ObjectUtils.nullSafeEquals(this.path, other.path);
}

@Override
Expand Down
Expand Up @@ -253,8 +253,8 @@ public boolean equals(@Nullable Object obj) {
if (!(obj instanceof AbstractPersistentProperty)) {
return false;
}
AbstractPersistentProperty<?> that = (AbstractPersistentProperty<?>) obj;
return this.property.equals(that.property);
AbstractPersistentProperty<?> other = (AbstractPersistentProperty<?>) obj;
return this.property.equals(other.property);
}

@Override
Expand Down
Expand Up @@ -202,8 +202,8 @@ public boolean equals(@Nullable Object obj) {
if (!(obj instanceof Property)) {
return false;
}
Property that = (Property) obj;
return this.field.isPresent() ? this.field.equals(that.field) : this.descriptor.equals(that.descriptor);
Property other = (Property) obj;
return this.field.isPresent() ? this.field.equals(other.field) : this.descriptor.equals(other.descriptor);
}

@Override
Expand Down
Expand Up @@ -159,11 +159,11 @@ public boolean equals(Object o) {
if (!(o instanceof TargetWrapper)) {
return false;
}
TargetWrapper that = (TargetWrapper) o;
if (!ObjectUtils.nullSafeEquals(this.target, that.target)) {
TargetWrapper other = (TargetWrapper) o;
if (!ObjectUtils.nullSafeEquals(this.target, other.target)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.args, that.args);
return ObjectUtils.nullSafeEquals(this.args, other.args);
}

@Override
Expand Down
Expand Up @@ -126,8 +126,8 @@ public boolean equals(Object o) {
if (!(o instanceof PropertyPathInformation)) {
return false;
}
PropertyPathInformation that = (PropertyPathInformation) o;
return ObjectUtils.nullSafeEquals(this.path, that.path);
PropertyPathInformation other = (PropertyPathInformation) o;
return ObjectUtils.nullSafeEquals(this.path, other.path);
}

@Override
Expand Down
Expand Up @@ -484,11 +484,11 @@ public boolean equals(Object o) {
if (!(o instanceof PathAndBinding)) {
return false;
}
PathAndBinding<?, ?> that = (PathAndBinding<?, ?>) o;
if (!ObjectUtils.nullSafeEquals(this.path, that.path)) {
PathAndBinding<?, ?> other = (PathAndBinding<?, ?>) o;
if (!ObjectUtils.nullSafeEquals(this.path, other.path)) {
return false;
}
return ObjectUtils.nullSafeEquals(this.binding, that.binding);
return ObjectUtils.nullSafeEquals(this.binding, other.binding);
}

@Override
Expand Down

0 comments on commit f23a44f

Please sign in to comment.