Skip to content

Commit da8d7f8

Browse files
author
Mykola Mokhnach
committed
Remove isPositive verification for point coordinates
1 parent b238538 commit da8d7f8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/main/java/io/appium/java_client/touch/offset/PointOption.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package io.appium.java_client.touch.offset;
22

3-
import static com.google.common.base.Preconditions.checkArgument;
4-
import static java.lang.String.format;
53
import static java.util.Optional.ofNullable;
64

75
import io.appium.java_client.touch.ActionOptions;
@@ -13,8 +11,6 @@ public class PointOption<T extends PointOption<T>> extends ActionOptions<T> {
1311

1412
protected Point coordinates;
1513

16-
private static final String ERROR_MESSAGE_TEMPLATE = "%s coordinate value should be equal or greater than zero";
17-
1814
/**
1915
* It creates a built instance of {@link PointOption} which takes x and y coordinates.
2016
* This is offset from the upper left corner of the screen.
@@ -36,14 +32,14 @@ public static PointOption point(int xOffset, int yOffset) {
3632
* @return self-reference
3733
*/
3834
public T withCoordinates(int xOffset, int yOffset) {
39-
checkArgument(xOffset >= 0, format(ERROR_MESSAGE_TEMPLATE, "X"));
40-
checkArgument(yOffset >= 0, format(ERROR_MESSAGE_TEMPLATE, "Y"));
4135
coordinates = new Point(xOffset, yOffset);
36+
//noinspection unchecked
4237
return (T) this;
4338
}
4439

4540
@Override
4641
protected void verify() {
42+
//noinspection ResultOfMethodCallIgnored
4743
ofNullable(coordinates).orElseThrow(() -> new IllegalArgumentException(
4844
"Coordinate values must be defined"));
4945
}

0 commit comments

Comments
 (0)