From c62dbf9d88b9a9193e1e41454c94e10991b06ca3 Mon Sep 17 00:00:00 2001 From: Simon Mavi Stewart Date: Tue, 28 Sep 2021 15:09:09 +0100 Subject: [PATCH] Clean up some stylistic nits. No logical changes --- .../openqa/selenium/chromium/AddHasCasting.java | 16 +++++++++++----- .../chromium/AddHasNetworkConditions.java | 5 +++-- .../src/org/openqa/selenium/chromium/HasCdp.java | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/java/src/org/openqa/selenium/chromium/AddHasCasting.java b/java/src/org/openqa/selenium/chromium/AddHasCasting.java index 54e569ea75b41..f12d3e080d84c 100644 --- a/java/src/org/openqa/selenium/chromium/AddHasCasting.java +++ b/java/src/org/openqa/selenium/chromium/AddHasCasting.java @@ -51,27 +51,33 @@ public Class getDescribedInterface() { @Override public HasCasting getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) { return new HasCasting() { - @Override public List> getCastSinks() { + @SuppressWarnings("unchecked") + @Override + public List> getCastSinks() { return (List>) executeMethod.execute(GET_CAST_SINKS, null); } - @Override public void selectCastSink(String deviceName) { + @Override + public void selectCastSink(String deviceName) { Require.nonNull("Device Name", deviceName); executeMethod.execute(SET_CAST_SINK_TO_USE, ImmutableMap.of("sinkName", deviceName)); } - @Override public void startTabMirroring(String deviceName) { + @Override + public void startTabMirroring(String deviceName) { Require.nonNull("Device Name", deviceName); executeMethod.execute(START_CAST_TAB_MIRRORING, ImmutableMap.of("sinkName", deviceName)); } - @Override public String getCastIssueMessage() { + @Override + public String getCastIssueMessage() { return executeMethod.execute(GET_CAST_ISSUE_MESSAGE, null).toString(); } - @Override public void stopCasting(String deviceName) { + @Override + public void stopCasting(String deviceName) { Require.nonNull("Device Name", deviceName); executeMethod.execute(STOP_CASTING, ImmutableMap.of("sinkName", deviceName)); diff --git a/java/src/org/openqa/selenium/chromium/AddHasNetworkConditions.java b/java/src/org/openqa/selenium/chromium/AddHasNetworkConditions.java index 47e8a122627c8..cad4122f05e4f 100644 --- a/java/src/org/openqa/selenium/chromium/AddHasNetworkConditions.java +++ b/java/src/org/openqa/selenium/chromium/AddHasNetworkConditions.java @@ -42,8 +42,8 @@ public class AddHasNetworkConditions implements AugmenterProvider COMMANDS = ImmutableMap.of( - GET_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions",HttpMethod.GET), - SET_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions",HttpMethod.POST), + GET_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions", HttpMethod.GET), + SET_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions", HttpMethod.POST), DELETE_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions", HttpMethod.DELETE)); @Override @@ -66,6 +66,7 @@ public HasNetworkConditions getImplementation(Capabilities capabilities, Execute return new HasNetworkConditions() { @Override public ChromiumNetworkConditions getNetworkConditions() { + @SuppressWarnings("unchecked") Map result = (Map) executeMethod.execute(GET_NETWORK_CONDITIONS, null); ChromiumNetworkConditions networkConditions = new ChromiumNetworkConditions(); networkConditions.setOffline((Boolean) result.getOrDefault(ChromiumNetworkConditions.OFFLINE, false)); diff --git a/java/src/org/openqa/selenium/chromium/HasCdp.java b/java/src/org/openqa/selenium/chromium/HasCdp.java index e2b09868d1e66..8d3f7060f608b 100644 --- a/java/src/org/openqa/selenium/chromium/HasCdp.java +++ b/java/src/org/openqa/selenium/chromium/HasCdp.java @@ -39,5 +39,5 @@ public interface HasCdp { * @param parameters any information needed to execute the Dev Tools command. * @return the name and value of the response. */ - public Map executeCdpCommand(String commandName, Map parameters); + Map executeCdpCommand(String commandName, Map parameters); }