Skip to content

Commit

Permalink
Use Objects.equals where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Dec 17, 2024
1 parent 0798e8b commit f22af57
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/hudson/plugins/ec2/SpotConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ public boolean equals(Object obj) {

String normalizedBid = normalizeBid(this.spotMaxBidPrice);
String otherNormalizedBid = normalizeBid(config.spotMaxBidPrice);
boolean normalizedBidsAreEqual =
normalizedBid == null ? (otherNormalizedBid == null) : normalizedBid.equals(otherNormalizedBid);
boolean normalizedBidsAreEqual = Objects.equals(normalizedBid, otherNormalizedBid);
boolean blockReservationIsEqual = true;
if (this.spotBlockReservationDuration != config.spotBlockReservationDuration) {
blockReservationIsEqual = false;
Expand Down

0 comments on commit f22af57

Please sign in to comment.