Merge branch '2.0.x'

This commit is contained in:
Phillip Webb 2018-07-28 10:43:01 +01:00
commit 566056fd1a
7 changed files with 15 additions and 15 deletions

View File

@ -25,7 +25,7 @@ public interface HotelSummary {
Double getAverageRating();
default Integer getAverageRatingRounded() {
return (getAverageRating() != null ? (int) Math.round(getAverageRating()) : null);
return (getAverageRating() != null) ? (int) Math.round(getAverageRating()) : null;
}
}

View File

@ -91,7 +91,7 @@ class HotelServiceImpl implements HotelService {
@Override
public long getNumberOfReviewsWithRating(Rating rating) {
Long count = this.ratingCount.get(rating);
return (count != null ? count : 0);
return (count != null) ? count : 0;
}
}

View File

@ -33,11 +33,6 @@ public final class VehicleIdentificationNumber {
this.vin = vin;
}
@Override
public int hashCode() {
return this.vin.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@ -49,6 +44,11 @@ public final class VehicleIdentificationNumber {
return this.vin.equals(((VehicleIdentificationNumber) obj).vin);
}
@Override
public int hashCode() {
return this.vin.hashCode();
}
@Override
public String toString() {
return this.vin;

View File

@ -49,11 +49,6 @@ public class VehicleDetails {
return this.model;
}
@Override
public int hashCode() {
return this.make.hashCode() * 31 + this.model.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@ -66,4 +61,9 @@ public class VehicleDetails {
return this.make.equals(other.make) && this.model.equals(other.model);
}
@Override
public int hashCode() {
return this.make.hashCode() * 31 + this.model.hashCode();
}
}

View File

@ -21,7 +21,7 @@ public class DefaultEchoService implements EchoService {
private final String echoFormat;
public DefaultEchoService(String echoFormat) {
this.echoFormat = (echoFormat != null ? echoFormat : "%s");
this.echoFormat = (echoFormat != null) ? echoFormat : "%s";
}
@Override

View File

@ -21,7 +21,7 @@ public class DefaultEchoService implements EchoService {
private final String echoFormat;
public DefaultEchoService(String echoFormat) {
this.echoFormat = (echoFormat != null ? echoFormat : "%s");
this.echoFormat = (echoFormat != null) ? echoFormat : "%s";
}
@Override

View File

@ -21,7 +21,7 @@ public class DefaultEchoService implements EchoService {
private final String echoFormat;
public DefaultEchoService(String echoFormat) {
this.echoFormat = (echoFormat != null ? echoFormat : "%s");
this.echoFormat = (echoFormat != null) ? echoFormat : "%s";
}
@Override