Skip to content

Commit 2df9f52

Browse files
authored
build: Enable Checkstyle SingleSpaceSeparator check (#2057)
1 parent e7b2436 commit 2df9f52

File tree

9 files changed

+12
-11
lines changed

9 files changed

+12
-11
lines changed

config/checkstyle/appium-style.xml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<message key="ws.notPreceded"
6464
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
6565
</module>
66+
<module name="SingleSpaceSeparator"/>
6667
<module name="OneStatementPerLine"/>
6768
<module name="MultipleVariableDeclarations"/>
6869
<module name="ArrayTypeStyle"/>

src/main/java/io/appium/java_client/android/AndroidMobileCommandHelper.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public class AndroidMobileCommandHelper extends MobileCommand {
9191
return Map.entry(GET_PERFORMANCE_DATA, Map.of(
9292
"packageName", packageName,
9393
"dataType", dataType,
94-
"dataReadTimeout", dataReadTimeout
94+
"dataReadTimeout", dataReadTimeout
9595
));
9696
}
9797

@@ -201,7 +201,7 @@ public class AndroidMobileCommandHelper extends MobileCommand {
201201
* @return a key-value pair. The key is the command name. The value is a {@link Map} command arguments.
202202
*/
203203
@Deprecated
204-
public static Map.Entry<String, Map<String, ?>> replaceElementValueCommand(
204+
public static Map.Entry<String, Map<String, ?>> replaceElementValueCommand(
205205
RemoteWebElement remoteWebElement, String value) {
206206
return Map.entry(REPLACE_VALUE, Map.of(
207207
"id", remoteWebElement.getId(),
@@ -241,7 +241,7 @@ public class AndroidMobileCommandHelper extends MobileCommand {
241241
String phoneNumber, GsmCallActions gsmCallActions) {
242242
return Map.entry(GSM_CALL, Map.of(
243243
"phoneNumber", phoneNumber,
244-
"action", gsmCallActions.name().toLowerCase()
244+
"action", gsmCallActions.name().toLowerCase()
245245
));
246246
}
247247

src/main/java/io/appium/java_client/android/SupportsSpecialEmulatorCommands.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ default void sendSMS(String phoneNumber, String message) {
3434
// TODO: Remove the fallback
3535
CommandExecutionHelper.execute(
3636
markExtensionAbsence(extName),
37-
Map.entry(SEND_SMS, Map.of(
37+
Map.entry(SEND_SMS, Map.of(
3838
"phoneNumber", phoneNumber,
3939
"message", message
4040
))

src/main/java/io/appium/java_client/android/connection/HasNetworkConnection.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ default ConnectionState getConnection() {
7171
return new ConnectionState(
7272
((boolean) result.get("wifi") ? ConnectionState.WIFI_MASK : 0)
7373
| ((boolean) result.get("data") ? ConnectionState.DATA_MASK : 0)
74-
| ((boolean) result.get("airplaneMode") ? ConnectionState.AIRPLANE_MODE_MASK : 0)
74+
| ((boolean) result.get("airplaneMode") ? ConnectionState.AIRPLANE_MODE_MASK : 0)
7575
);
7676
} catch (UnsupportedCommandException e) {
7777
// TODO: Remove the fallback

src/main/java/io/appium/java_client/functions/AppiumFunction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* @param <T> The return type
3131
*/
3232
@FunctionalInterface
33-
public interface AppiumFunction<F, T> extends Function<F, T>, java.util.function.Function<F, T> {
33+
public interface AppiumFunction<F, T> extends Function<F, T>, java.util.function.Function<F, T> {
3434

3535
@Override default <V> AppiumFunction<V, T> compose(java.util.function.Function<? super V, ? extends F> before) {
3636
Objects.requireNonNull(before);

src/main/java/io/appium/java_client/ios/options/other/SupportsCommandTimeoutsOption.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ default T setCommandTimeouts(Duration timeout) {
6262
default Optional<Either<CommandTimeouts, Duration>> getCommandTimeouts() {
6363
return Optional.ofNullable(getCapability(COMMAND_TIMEOUTS_OPTION))
6464
.map(String::valueOf)
65-
.map(v -> v.trim().startsWith("{")
65+
.map(v -> v.trim().startsWith("{")
6666
? Either.left(new CommandTimeouts(v))
6767
: Either.right(toDuration(v))
6868
);

src/main/java/io/appium/java_client/serverevents/ServerEvents.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ServerEvents {
1414
public final List<TimedEvent> events;
1515
public final String jsonData;
1616

17-
public void save(Path output) throws IOException {
17+
public void save(Path output) throws IOException {
1818
Files.write(output, this.jsonData.getBytes());
1919
}
2020
}

src/test/java/io/appium/java_client/android/AndroidSearchingTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public void setup() {
3333
startActivity(".ApiDemos");
3434
}
3535

36-
@Test public void findByAccessibilityIdTest() {
36+
@Test public void findByAccessibilityIdTest() {
3737
assertNotEquals(driver.findElement(AppiumBy.accessibilityId("Graphics")).getText(), null);
3838
assertEquals(driver.findElements(AppiumBy.accessibilityId("Graphics")).size(), 1);
3939
}
4040

41-
@Test public void findByAndroidUIAutomatorTest() {
41+
@Test public void findByAndroidUIAutomatorTest() {
4242
assertNotEquals(driver
4343
.findElement(AppiumBy
4444
.androidUIAutomator("new UiSelector().clickable(true)")).getText(), null);

src/test/java/io/appium/java_client/pagefactory_tests/TimeoutTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private static long getPerformanceDiff(long expectedMs, Runnable runnable) {
6969
long startMark = currentTimeMillis();
7070
runnable.run();
7171
long endMark = currentTimeMillis();
72-
return abs(expectedMs - (endMark - startMark));
72+
return abs(expectedMs - (endMark - startMark));
7373
}
7474

7575
private static String assertionMessage(Duration expectedDuration) {

0 commit comments

Comments
 (0)