Skip to content

Commit 8472b4f

Browse files
#565: Code style issues were fixed.
1 parent 69ab315 commit 8472b4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+177
-161
lines changed

google-style.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
value="Package name ''{0}'' must match pattern ''{1}''."/>
9898
</module>
9999
<module name="TypeName">
100-
<property name="format" value="^([iOSFindBys]||[iOSFindBy]||[iOSFindAll])||([A-Z][a-zA-Z0-9])*$"/>
100+
<property name="format" value="^([*iOSFindBy*]||[*iOSXCUITFind*])||([A-Z][a-zA-Z0-9])*$"/>
101101
<message key="name.invalidPattern"
102102
value="Type name ''{0}'' must match pattern ''{1}''."/>
103103
</module>

src/main/java/io/appium/java_client/ScreenshotState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package io.appium.java_client;
1818

19+
import static nu.pattern.OpenCV.loadShared;
20+
1921
import org.opencv.core.Core;
2022
import org.opencv.core.CvType;
2123
import org.opencv.core.Mat;
@@ -32,8 +34,6 @@
3234
import java.util.function.Function;
3335
import java.util.function.Supplier;
3436

35-
import static nu.pattern.OpenCV.loadShared;
36-
3737
public class ScreenshotState {
3838
private static final Duration DEFAULT_INTERVAL_MS = Duration.ofMillis(500);
3939

src/main/java/io/appium/java_client/pagefactory/AndroidBy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package io.appium.java_client.pagefactory;
1818

1919
/**
20-
* Used to build a complex android automator locator
20+
* Used to build a complex android automator locator.
2121
*/
2222
public @interface AndroidBy {
2323
/**

src/main/java/io/appium/java_client/pagefactory/AndroidFindAll.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717
package io.appium.java_client.pagefactory;
1818

19-
import java.lang.annotation.Repeatable;
20-
import java.lang.annotation.Retention;
21-
import java.lang.annotation.Target;
22-
2319
import static java.lang.annotation.ElementType.FIELD;
2420
import static java.lang.annotation.ElementType.TYPE;
2521
import static java.lang.annotation.RetentionPolicy.RUNTIME;
2622

23+
import java.lang.annotation.Repeatable;
24+
import java.lang.annotation.Retention;
25+
import java.lang.annotation.Target;
26+
2727
/**
2828
* Used to mark a field on a Page/Screen Object to indicate that lookup should use a
2929
* series of {@link io.appium.java_client.pagefactory.AndroidBy} tags

src/main/java/io/appium/java_client/pagefactory/AndroidFindBy.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717
package io.appium.java_client.pagefactory;
1818

19-
import java.lang.annotation.Repeatable;
20-
import java.lang.annotation.Retention;
21-
import java.lang.annotation.Target;
22-
2319
import static java.lang.annotation.ElementType.FIELD;
2420
import static java.lang.annotation.ElementType.TYPE;
2521
import static java.lang.annotation.RetentionPolicy.RUNTIME;
2622

23+
import java.lang.annotation.Repeatable;
24+
import java.lang.annotation.Retention;
25+
import java.lang.annotation.Target;
26+
2727

2828
/**
2929
* Used to mark a field on a Page Object to indicate an alternative mechanism for locating the

src/main/java/io/appium/java_client/pagefactory/AndroidFindByAllSet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package io.appium.java_client.pagefactory;
22

3-
import java.lang.annotation.Retention;
4-
import java.lang.annotation.Target;
5-
63
import static java.lang.annotation.ElementType.FIELD;
74
import static java.lang.annotation.ElementType.TYPE;
85
import static java.lang.annotation.RetentionPolicy.RUNTIME;
96

7+
import java.lang.annotation.Retention;
8+
import java.lang.annotation.Target;
9+
1010
/**
1111
* Defines set of chained/possible locators. Each one locator
1212
* should be defined with {@link AndroidFindAll}

src/main/java/io/appium/java_client/pagefactory/AndroidFindByChainSet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package io.appium.java_client.pagefactory;
22

3-
import java.lang.annotation.Retention;
4-
import java.lang.annotation.Target;
5-
63
import static java.lang.annotation.ElementType.FIELD;
74
import static java.lang.annotation.ElementType.TYPE;
85
import static java.lang.annotation.RetentionPolicy.RUNTIME;
96

7+
import java.lang.annotation.Retention;
8+
import java.lang.annotation.Target;
9+
1010
/**
1111
* Defines set of chained/possible locators. Each one locator
1212
* should be defined with {@link io.appium.java_client.pagefactory.AndroidFindBys}

src/main/java/io/appium/java_client/pagefactory/AndroidFindBySet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
package io.appium.java_client.pagefactory;
1818

19-
import java.lang.annotation.Retention;
20-
import java.lang.annotation.Target;
21-
2219
import static java.lang.annotation.ElementType.FIELD;
2320
import static java.lang.annotation.ElementType.TYPE;
2421
import static java.lang.annotation.RetentionPolicy.RUNTIME;
2522

23+
import java.lang.annotation.Retention;
24+
import java.lang.annotation.Target;
25+
2626
/**
2727
* Defines set of chained/possible locators. Each one locator
2828
* should be defined with {@link io.appium.java_client.pagefactory.AndroidFindBy}

src/main/java/io/appium/java_client/pagefactory/AndroidFindBys.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717
package io.appium.java_client.pagefactory;
1818

19-
import java.lang.annotation.Repeatable;
20-
import java.lang.annotation.Retention;
21-
import java.lang.annotation.Target;
22-
2319
import static java.lang.annotation.ElementType.FIELD;
2420
import static java.lang.annotation.ElementType.TYPE;
2521
import static java.lang.annotation.RetentionPolicy.RUNTIME;
2622

23+
import java.lang.annotation.Repeatable;
24+
import java.lang.annotation.Retention;
25+
import java.lang.annotation.Target;
26+
2727
/**
2828
* Used to mark a field on a Page Object to indicate that lookup should use
2929
* a series of {@link io.appium.java_client.pagefactory.AndroidBy} tags.

src/main/java/io/appium/java_client/pagefactory/DefaultElementByBuilder.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
package io.appium.java_client.pagefactory;
1818

19+
import static java.util.Arrays.asList;
20+
import static java.util.Arrays.sort;
21+
import static java.util.Optional.ofNullable;
22+
import static org.apache.commons.lang3.ArrayUtils.add;
23+
1924
import io.appium.java_client.pagefactory.bys.ContentMappedBy;
2025
import io.appium.java_client.pagefactory.bys.ContentType;
2126
import io.appium.java_client.pagefactory.bys.builder.AppiumByBuilder;
@@ -34,12 +39,11 @@
3439
import java.lang.reflect.Field;
3540
import java.lang.reflect.InvocationTargetException;
3641
import java.lang.reflect.Method;
37-
import java.util.*;
38-
39-
import static java.util.Arrays.asList;
40-
import static java.util.Arrays.sort;
41-
import static java.util.Optional.ofNullable;
42-
import static org.apache.commons.lang3.ArrayUtils.add;
42+
import java.util.ArrayList;
43+
import java.util.Comparator;
44+
import java.util.HashMap;
45+
import java.util.List;
46+
import java.util.Map;
4347

4448
public class DefaultElementByBuilder extends AppiumByBuilder {
4549

@@ -133,9 +137,9 @@ private By[] getBys(Class<? extends Annotation> singleLocator, Class<? extends A
133137
try {
134138
value = annotationClass.getMethod(VALUE, ANNOTATION_ARGUMENTS);
135139
set = (Annotation[]) value.invoke(a, ANNOTATION_PARAMETERS);
136-
} catch (NoSuchMethodException| IllegalAccessException| InvocationTargetException e) {
137-
throw new ClassCastException(String.format("The annotation '%s' has no convenient '%s' method which " +
138-
"returns array of annotations", annotationClass.getName(), VALUE));
140+
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
141+
throw new ClassCastException(String.format("The annotation '%s' has no convenient '%s' method which "
142+
+ "returns array of annotations", annotationClass.getName(), VALUE));
139143
}
140144

141145
sort(set, comparator);
@@ -256,14 +260,12 @@ public int compare(Annotation o1, Annotation o2) {
256260

257261
if (p2 > p1) {
258262
return -1;
259-
}
260-
else if (p2 < p1){
263+
} else if (p2 < p1) {
261264
return 1;
262-
}
263-
else {
265+
} else {
264266
return 0;
265267
}
266-
} catch (IllegalAccessException|InvocationTargetException e) {
268+
} catch (IllegalAccessException | InvocationTargetException e) {
267269
throw new RuntimeException(e);
268270
}
269271
}

0 commit comments

Comments
 (0)