Skip to content

Commit 72bcde3

Browse files
committed
Update overloaded equals
1 parent 4b93e2a commit 72bcde3

File tree

1 file changed

+4
-8
lines changed
  • src/main/java/com/assertthat/selenium_shutterbug/core

1 file changed

+4
-8
lines changed

src/main/java/com/assertthat/selenium_shutterbug/core/Snapshot.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,14 @@ public void save(String path) {
148148
}
149149

150150
/**
151-
* @param o Object to compare with
151+
* @param other Snapshot to compare with
152152
* @param deviation allowed deviation while comparing.
153153
* @return true if the the percentage of differences
154154
* between current image and provided one is less than or equal to <b>deviation</b>
155155
*/
156-
public boolean equals(Object o, double deviation) {
157-
if (this == o) return true;
158-
if (!(o instanceof Snapshot)) return false;
159-
160-
Snapshot that = (Snapshot) o;
161-
162-
return getImage() != null ? ImageProcessor.imagesAreEquals(getImage(), that.getImage(), deviation) : that.getImage() == null;
156+
public boolean equals(Snapshot other, double deviation) {
157+
if (this == other) return true;
158+
return getImage() != null ? ImageProcessor.imagesAreEquals(getImage(), other.getImage(), deviation) : other.getImage() == null;
163159
}
164160

165161
/**

0 commit comments

Comments
 (0)