Skip to content

Commit 3088176

Browse files
authored
Merge 004fd7a into c149513
2 parents c149513 + 004fd7a commit 3088176

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

java/src/org/openqa/selenium/Rectangle.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.openqa.selenium;
1919

20+
import java.util.Objects;
21+
2022
public class Rectangle {
2123

2224
public int x;
@@ -73,16 +75,12 @@ public boolean equals(Object o) {
7375

7476
Rectangle rectangle = (Rectangle) o;
7577

76-
if (!getPoint().equals(rectangle.getPoint())) {
77-
return false;
78-
}
79-
return getDimension().equals(rectangle.getDimension());
78+
return x == rectangle.x && y == rectangle.y && height == rectangle.height
79+
&& width == rectangle.width;
8080
}
8181

8282
@Override
8383
public int hashCode() {
84-
int result = getPoint().hashCode();
85-
result = 31 * result + getDimension().hashCode();
86-
return result;
84+
return Objects.hash(x, y, height, width);
8785
}
8886
}

0 commit comments

Comments
 (0)