From e81d3ed93fdb2fc0ecc2730167318243038891d7 Mon Sep 17 00:00:00 2001 From: Alexei Barantsev Date: Sun, 26 Apr 2020 22:39:53 +0300 Subject: [PATCH] [java] Reordering modifiers as recommended by linter to match Java Language Specification, no functional changes --- .../selenium/webdriven/ElementFinder.java | 3 +- .../webdriven/WebDriverCommandProcessor.java | 3 +- .../webdriven/commands/AttachFile.java | 3 +- .../selenium/webdriven/commands/Type.java | 2 +- .../openqa/selenium/WebDriverException.java | 6 +-- .../selenium/chrome/ChromeDriverService.java | 4 +- .../edge/ChromiumEdgeDriverService.java | 2 +- .../selenium/edge/EdgeDriverService.java | 2 +- .../firefox/FirefoxDriverLogLevel.java | 2 +- .../selenium/firefox/FirefoxOptions.java | 2 +- .../selenium/ie/InternetExplorerDriver.java | 40 +++++++++---------- .../ie/InternetExplorerDriverService.java | 6 +-- .../selenium/ie/InternetExplorerOptions.java | 2 +- .../openqa/selenium/interactions/Actions.java | 2 +- .../openqa/selenium/json/NumberCoercer.java | 2 +- .../json/SimplePropertyDescriptor.java | 2 +- .../openqa/selenium/net/HostIdentifier.java | 4 +- .../selenium/opera/OperaDriverService.java | 2 +- .../remote/AcceptedW3CCapabilityKeys.java | 3 +- .../selenium/remote/HttpCommandExecutor.java | 2 +- .../selenium/remote/NewSessionPayload.java | 2 +- .../selenium/remote/ProtocolHandshake.java | 2 +- .../remote/RemoteWebDriverBuilder.java | 5 ++- .../selenium/remote/http/UrlTemplate.java | 2 +- .../remote/http/netty/NettyClient.java | 2 +- .../remote/service/DriverService.java | 2 +- .../org/openqa/selenium/support/Color.java | 2 +- .../support/ui/ExpectedConditions.java | 2 +- .../selenium/support/ui/FluentWait.java | 2 +- .../selenium/grid/web/ProtocolConverter.java | 4 +- .../grid/web/ReverseProxyHandler.java | 4 +- .../remote/server/ActiveSessionFactory.java | 4 +- .../remote/server/ActiveSessions.java | 2 +- .../commandhandler/ExceptionHandler.java | 4 +- .../server/log/PerSessionLogHandler.java | 2 +- .../log/SessionLogsToFileRepository.java | 2 +- 36 files changed, 70 insertions(+), 67 deletions(-) diff --git a/java/client/src/com/thoughtworks/selenium/webdriven/ElementFinder.java b/java/client/src/com/thoughtworks/selenium/webdriven/ElementFinder.java index 3be06db3fa9fd..31c4a90a77bee 100644 --- a/java/client/src/com/thoughtworks/selenium/webdriven/ElementFinder.java +++ b/java/client/src/com/thoughtworks/selenium/webdriven/ElementFinder.java @@ -33,7 +33,8 @@ import java.util.logging.Logger; public class ElementFinder { - private final static Logger log = Logger.getLogger(ElementFinder.class.getName()); + private static final Logger log = Logger.getLogger(ElementFinder.class.getName()); + private final String findElement; private final String sizzle; private final Map additionalLocators = new HashMap<>(); diff --git a/java/client/src/com/thoughtworks/selenium/webdriven/WebDriverCommandProcessor.java b/java/client/src/com/thoughtworks/selenium/webdriven/WebDriverCommandProcessor.java index 1d679ca98fd92..607998a01c376 100644 --- a/java/client/src/com/thoughtworks/selenium/webdriven/WebDriverCommandProcessor.java +++ b/java/client/src/com/thoughtworks/selenium/webdriven/WebDriverCommandProcessor.java @@ -40,7 +40,8 @@ */ public class WebDriverCommandProcessor implements CommandProcessor, WrapsDriver { - private final static long DEFAULT_PAUSE = 500L; // milliseconds + private static final long DEFAULT_PAUSE = 500L; // milliseconds + private final Map> seleneseMethods = new HashMap<>(); private final String baseUrl; private final Timer timer; diff --git a/java/client/src/com/thoughtworks/selenium/webdriven/commands/AttachFile.java b/java/client/src/com/thoughtworks/selenium/webdriven/commands/AttachFile.java index bf07396194c0b..fabc667ce321f 100644 --- a/java/client/src/com/thoughtworks/selenium/webdriven/commands/AttachFile.java +++ b/java/client/src/com/thoughtworks/selenium/webdriven/commands/AttachFile.java @@ -36,7 +36,8 @@ import java.util.logging.Logger; public class AttachFile extends SeleneseCommand { - private final static Logger LOGGER = Logger.getLogger(AttachFile.class.getName()); + private static final Logger LOGGER = Logger.getLogger(AttachFile.class.getName()); + private final ElementFinder finder; public AttachFile(ElementFinder finder) { diff --git a/java/client/src/com/thoughtworks/selenium/webdriven/commands/Type.java b/java/client/src/com/thoughtworks/selenium/webdriven/commands/Type.java index 39480c0c4405d..fdbbd99adf31f 100644 --- a/java/client/src/com/thoughtworks/selenium/webdriven/commands/Type.java +++ b/java/client/src/com/thoughtworks/selenium/webdriven/commands/Type.java @@ -29,7 +29,7 @@ import java.util.logging.Logger; public class Type extends SeleneseCommand { - private final static Logger log = Logger.getLogger(Type.class.getName()); + private static final Logger log = Logger.getLogger(Type.class.getName()); private final AlertOverride alertOverride; private final JavascriptLibrary js; diff --git a/java/client/src/org/openqa/selenium/WebDriverException.java b/java/client/src/org/openqa/selenium/WebDriverException.java index 34a07ba78dce2..e1c2dc6e5b850 100644 --- a/java/client/src/org/openqa/selenium/WebDriverException.java +++ b/java/client/src/org/openqa/selenium/WebDriverException.java @@ -30,10 +30,10 @@ public class WebDriverException extends RuntimeException { public static final String DRIVER_INFO = "Driver info"; protected static final String BASE_SUPPORT_URL = "https://selenium.dev/exceptions/"; - private final static String HOST_NAME = HostIdentifier.getHostName(); - private final static String HOST_ADDRESS = HostIdentifier.getHostAddress(); + private static final String HOST_NAME = HostIdentifier.getHostName(); + private static final String HOST_ADDRESS = HostIdentifier.getHostAddress(); - private Map extraInfo = new HashMap<>(); + private final Map extraInfo = new HashMap<>(); public WebDriverException() { super(); diff --git a/java/client/src/org/openqa/selenium/chrome/ChromeDriverService.java b/java/client/src/org/openqa/selenium/chrome/ChromeDriverService.java index ac77006480a55..6d4ddd30a23d3 100644 --- a/java/client/src/org/openqa/selenium/chrome/ChromeDriverService.java +++ b/java/client/src/org/openqa/selenium/chrome/ChromeDriverService.java @@ -48,7 +48,7 @@ public class ChromeDriverService extends DriverService { * System property that defines the location of the log that will be written by * the {@link #createDefaultService() default service}. */ - public final static String CHROME_DRIVER_LOG_PROPERTY = "webdriver.chrome.logfile"; + public static final String CHROME_DRIVER_LOG_PROPERTY = "webdriver.chrome.logfile"; /** * Boolean system property that defines whether chromedriver should append to existing log file. @@ -74,7 +74,7 @@ public class ChromeDriverService extends DriverService { * System property that defines comma-separated list of remote IPv4 addresses which are * allowed to connect to ChromeDriver. */ - public final static String CHROME_DRIVER_WHITELISTED_IPS_PROPERTY = + public static final String CHROME_DRIVER_WHITELISTED_IPS_PROPERTY = "webdriver.chrome.whitelistedIps"; /** diff --git a/java/client/src/org/openqa/selenium/edge/ChromiumEdgeDriverService.java b/java/client/src/org/openqa/selenium/edge/ChromiumEdgeDriverService.java index f9ac3ccef53c5..91e9309570e4c 100644 --- a/java/client/src/org/openqa/selenium/edge/ChromiumEdgeDriverService.java +++ b/java/client/src/org/openqa/selenium/edge/ChromiumEdgeDriverService.java @@ -44,7 +44,7 @@ public class ChromiumEdgeDriverService extends EdgeDriverService { * System property that defines comma-separated list of remote IPv4 addresses which are * allowed to connect to MSEdgeDriver. */ - public final static String EDGE_DRIVER_ALLOWED_IPS_PROPERTY = "webdriver.edge.withAllowedIps"; + public static final String EDGE_DRIVER_ALLOWED_IPS_PROPERTY = "webdriver.edge.withAllowedIps"; public ChromiumEdgeDriverService( File executable, diff --git a/java/client/src/org/openqa/selenium/edge/EdgeDriverService.java b/java/client/src/org/openqa/selenium/edge/EdgeDriverService.java index 79767932aa3e0..669a575842777 100644 --- a/java/client/src/org/openqa/selenium/edge/EdgeDriverService.java +++ b/java/client/src/org/openqa/selenium/edge/EdgeDriverService.java @@ -70,7 +70,7 @@ public EdgeDriverService( unmodifiableMap(new HashMap<>(environment))); } - public static abstract class Builder> + public abstract static class Builder> extends DriverService.Builder { public abstract boolean isLegacy(); diff --git a/java/client/src/org/openqa/selenium/firefox/FirefoxDriverLogLevel.java b/java/client/src/org/openqa/selenium/firefox/FirefoxDriverLogLevel.java index 04084eafe1fff..2bd2915a8069c 100644 --- a/java/client/src/org/openqa/selenium/firefox/FirefoxDriverLogLevel.java +++ b/java/client/src/org/openqa/selenium/firefox/FirefoxDriverLogLevel.java @@ -34,7 +34,7 @@ public enum FirefoxDriverLogLevel { ERROR, FATAL; - private final static Map logLevelToGeckoLevelMap + private static final Map logLevelToGeckoLevelMap = new ImmutableMap.Builder() .put(Level.ALL, TRACE) .put(Level.FINEST, TRACE) diff --git a/java/client/src/org/openqa/selenium/firefox/FirefoxOptions.java b/java/client/src/org/openqa/selenium/firefox/FirefoxOptions.java index 81a13563ebb66..416d041c6ee37 100644 --- a/java/client/src/org/openqa/selenium/firefox/FirefoxOptions.java +++ b/java/client/src/org/openqa/selenium/firefox/FirefoxOptions.java @@ -57,7 +57,7 @@ */ public class FirefoxOptions extends AbstractDriverOptions { - public final static String FIREFOX_OPTIONS = "moz:firefoxOptions"; + public static final String FIREFOX_OPTIONS = "moz:firefoxOptions"; private List args = new ArrayList<>(); private Map preferences = new HashMap<>(); diff --git a/java/client/src/org/openqa/selenium/ie/InternetExplorerDriver.java b/java/client/src/org/openqa/selenium/ie/InternetExplorerDriver.java index 18da9c5c97f8e..19869f40596a6 100644 --- a/java/client/src/org/openqa/selenium/ie/InternetExplorerDriver.java +++ b/java/client/src/org/openqa/selenium/ie/InternetExplorerDriver.java @@ -32,37 +32,37 @@ public class InternetExplorerDriver extends RemoteWebDriver { /** * Capability that defines whether to ignore the browser zoom level or not. */ - public final static String IGNORE_ZOOM_SETTING = "ignoreZoomSetting"; + public static final String IGNORE_ZOOM_SETTING = "ignoreZoomSetting"; /** * Capability that defines to use whether to use native or javascript events during operations. */ - public final static String NATIVE_EVENTS = CapabilityType.HAS_NATIVE_EVENTS; + public static final String NATIVE_EVENTS = CapabilityType.HAS_NATIVE_EVENTS; /** * Capability that defines the initial URL to be used when IE is launched. */ - public final static String INITIAL_BROWSER_URL = "initialBrowserUrl"; + public static final String INITIAL_BROWSER_URL = "initialBrowserUrl"; /** * Capability that defines how elements are scrolled into view in the InternetExplorerDriver. */ - public final static String ELEMENT_SCROLL_BEHAVIOR = CapabilityType.ELEMENT_SCROLL_BEHAVIOR; + public static final String ELEMENT_SCROLL_BEHAVIOR = CapabilityType.ELEMENT_SCROLL_BEHAVIOR; /** * Capability that defines which behaviour will be used if an unexpected Alert is found. */ - public final static String UNEXPECTED_ALERT_BEHAVIOR = CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR; + public static final String UNEXPECTED_ALERT_BEHAVIOR = CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR; /** * Capability that defines to use or not cleanup of element cache on document loading. */ - public final static String ENABLE_ELEMENT_CACHE_CLEANUP = "enableElementCacheCleanup"; + public static final String ENABLE_ELEMENT_CACHE_CLEANUP = "enableElementCacheCleanup"; /** * Capability that defines timeout in milliseconds for attaching to new browser window. */ - public final static String BROWSER_ATTACH_TIMEOUT = "browserAttachTimeout"; + public static final String BROWSER_ATTACH_TIMEOUT = "browserAttachTimeout"; /** * Capability that defines to ignore browser @@ -70,73 +70,73 @@ public class InternetExplorerDriver extends RemoteWebDriver { * * Setting this capability will make your tests unstable and hard to debug. */ - public final static String INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS = + public static final String INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS = "ignoreProtectedModeSettings"; /** * Capability that defines to use persistent hovering or not. */ - public final static String ENABLE_PERSISTENT_HOVERING = "enablePersistentHover"; + public static final String ENABLE_PERSISTENT_HOVERING = "enablePersistentHover"; /** * Capability that defines to focus to browser window or not before operation. */ - public final static String REQUIRE_WINDOW_FOCUS = "requireWindowFocus"; + public static final String REQUIRE_WINDOW_FOCUS = "requireWindowFocus"; /** * Capability that defines the location of the file where IEDriverServer * should write log messages to. */ - public final static String LOG_FILE = "logFile"; + public static final String LOG_FILE = "logFile"; /** * Capability that defines the detalization level the IEDriverServer logs. */ - public final static String LOG_LEVEL = "logLevel"; + public static final String LOG_LEVEL = "logLevel"; /** * Capability that defines the address of the host adapter on which * the IEDriverServer will listen for commands. */ - public final static String HOST = "host"; + public static final String HOST = "host"; /** * Capability that defines full path to directory to which will be * extracted supporting files of the IEDriverServer. */ - public final static String EXTRACT_PATH = "extractPath"; + public static final String EXTRACT_PATH = "extractPath"; /** * Capability that defines suppress or not diagnostic output of the IEDriverServer. */ - public final static String SILENT = "silent"; + public static final String SILENT = "silent"; /** * Capability that defines launch API of IE used by IEDriverServer. */ - public final static String FORCE_CREATE_PROCESS = "ie.forceCreateProcessApi"; + public static final String FORCE_CREATE_PROCESS = "ie.forceCreateProcessApi"; /** * Capability that defines to clean or not browser cache before launching IE by IEDriverServer. */ - public final static String IE_ENSURE_CLEAN_SESSION = "ie.ensureCleanSession"; + public static final String IE_ENSURE_CLEAN_SESSION = "ie.ensureCleanSession"; /** * Capability that defines setting the proxy information for a single IE process * without affecting the proxy settings of other instances of IE. */ - public final static String IE_USE_PER_PROCESS_PROXY = "ie.usePerProcessProxy"; + public static final String IE_USE_PER_PROCESS_PROXY = "ie.usePerProcessProxy"; /** * @deprecated Use {@link #IE_USE_PER_PROCESS_PROXY} (the one without the typo); */ @Deprecated - public final static String IE_USE_PRE_PROCESS_PROXY = IE_USE_PER_PROCESS_PROXY; + public static final String IE_USE_PRE_PROCESS_PROXY = IE_USE_PER_PROCESS_PROXY; /** * Capability that defines used IE CLI switches when {@link #FORCE_CREATE_PROCESS} is enabled. */ - public final static String IE_SWITCHES = "ie.browserCommandLineSwitches"; + public static final String IE_SWITCHES = "ie.browserCommandLineSwitches"; public InternetExplorerDriver() { this(null, null); diff --git a/java/client/src/org/openqa/selenium/ie/InternetExplorerDriverService.java b/java/client/src/org/openqa/selenium/ie/InternetExplorerDriverService.java index baf9e6623753e..5de2b9327c845 100644 --- a/java/client/src/org/openqa/selenium/ie/InternetExplorerDriverService.java +++ b/java/client/src/org/openqa/selenium/ie/InternetExplorerDriverService.java @@ -58,17 +58,17 @@ public class InternetExplorerDriverService extends DriverService { /** * System property that defines host to which will be bound IEDriverServer. */ - public final static String IE_DRIVER_HOST_PROPERTY = "webdriver.ie.driver.host"; + public static final String IE_DRIVER_HOST_PROPERTY = "webdriver.ie.driver.host"; /** * System property that defines path to which will be extracted IEDriverServer library. */ - public final static String IE_DRIVER_EXTRACT_PATH_PROPERTY = "webdriver.ie.driver.extractpath"; + public static final String IE_DRIVER_EXTRACT_PATH_PROPERTY = "webdriver.ie.driver.extractpath"; /** * System property that defines logging to stdout for IEDriverServer. */ - public final static String IE_DRIVER_SILENT_PROPERTY = "webdriver.ie.driver.silent"; + public static final String IE_DRIVER_SILENT_PROPERTY = "webdriver.ie.driver.silent"; /** * @param executable The IEDriverServer executable. diff --git a/java/client/src/org/openqa/selenium/ie/InternetExplorerOptions.java b/java/client/src/org/openqa/selenium/ie/InternetExplorerOptions.java index 9c6bde9c12918..2d61e6cc0e5b2 100644 --- a/java/client/src/org/openqa/selenium/ie/InternetExplorerOptions.java +++ b/java/client/src/org/openqa/selenium/ie/InternetExplorerOptions.java @@ -66,7 +66,7 @@ public class InternetExplorerOptions extends AbstractDriverOptions CAPABILITY_NAMES = Arrays.asList( + private static final List CAPABILITY_NAMES = Arrays.asList( BROWSER_ATTACH_TIMEOUT, ELEMENT_SCROLL_BEHAVIOR, ENABLE_PERSISTENT_HOVERING, diff --git a/java/client/src/org/openqa/selenium/interactions/Actions.java b/java/client/src/org/openqa/selenium/interactions/Actions.java index d45cddc741995..f8f0f5105679b 100644 --- a/java/client/src/org/openqa/selenium/interactions/Actions.java +++ b/java/client/src/org/openqa/selenium/interactions/Actions.java @@ -48,7 +48,7 @@ */ public class Actions { - private final static Logger LOG = Logger.getLogger(Actions.class.getName()); + private static final Logger LOG = Logger.getLogger(Actions.class.getName()); private final WebDriver driver; // W3C diff --git a/java/client/src/org/openqa/selenium/json/NumberCoercer.java b/java/client/src/org/openqa/selenium/json/NumberCoercer.java index 103728c646c24..7b59fed523307 100644 --- a/java/client/src/org/openqa/selenium/json/NumberCoercer.java +++ b/java/client/src/org/openqa/selenium/json/NumberCoercer.java @@ -28,7 +28,7 @@ class NumberCoercer extends TypeCoercer { - private final static Map, Class> PRIMITIVE_NUMBER_TYPES; + private static final Map, Class> PRIMITIVE_NUMBER_TYPES; static { Map, Class> builder = new HashMap<>(); builder.put(byte.class, Byte.class); diff --git a/java/client/src/org/openqa/selenium/json/SimplePropertyDescriptor.java b/java/client/src/org/openqa/selenium/json/SimplePropertyDescriptor.java index a9797d3d5381d..86b7beee9a726 100644 --- a/java/client/src/org/openqa/selenium/json/SimplePropertyDescriptor.java +++ b/java/client/src/org/openqa/selenium/json/SimplePropertyDescriptor.java @@ -24,7 +24,7 @@ public class SimplePropertyDescriptor { - private final static Function GET_CLASS_NAME = obj -> { + private static final Function GET_CLASS_NAME = obj -> { if (obj == null) { return null; } diff --git a/java/client/src/org/openqa/selenium/net/HostIdentifier.java b/java/client/src/org/openqa/selenium/net/HostIdentifier.java index ae28016b46760..0e8887bf76617 100644 --- a/java/client/src/org/openqa/selenium/net/HostIdentifier.java +++ b/java/client/src/org/openqa/selenium/net/HostIdentifier.java @@ -27,8 +27,8 @@ import java.util.concurrent.TimeUnit; public class HostIdentifier { - private final static String HOST_NAME; - private final static String HOST_ADDRESS; + private static final String HOST_NAME; + private static final String HOST_ADDRESS; static { // Ideally, we'd use InetAddress.getLocalHost, but this does a reverse DNS lookup. On Windows diff --git a/java/client/src/org/openqa/selenium/opera/OperaDriverService.java b/java/client/src/org/openqa/selenium/opera/OperaDriverService.java index 58d7ef1771a7a..443965a06e66a 100644 --- a/java/client/src/org/openqa/selenium/opera/OperaDriverService.java +++ b/java/client/src/org/openqa/selenium/opera/OperaDriverService.java @@ -48,7 +48,7 @@ public class OperaDriverService extends DriverService { * System property that defines the location of the log that will be written by * the {@link #createDefaultService() default service}. */ - public final static String OPERA_DRIVER_LOG_PROPERTY = "webdriver.opera.logfile"; + public static final String OPERA_DRIVER_LOG_PROPERTY = "webdriver.opera.logfile"; /** * Boolean system property that defines whether the OperaDriver executable should be started diff --git a/java/client/src/org/openqa/selenium/remote/AcceptedW3CCapabilityKeys.java b/java/client/src/org/openqa/selenium/remote/AcceptedW3CCapabilityKeys.java index 065a653a80fa7..03e0f9b1e5cd4 100644 --- a/java/client/src/org/openqa/selenium/remote/AcceptedW3CCapabilityKeys.java +++ b/java/client/src/org/openqa/selenium/remote/AcceptedW3CCapabilityKeys.java @@ -23,7 +23,7 @@ public class AcceptedW3CCapabilityKeys implements Predicate { - private final static Predicate ACCEPTED_W3C_PATTERNS = Stream.of( + private static final Predicate ACCEPTED_W3C_PATTERNS = Stream.of( "^[\\w-]+:.*$", "^acceptInsecureCerts$", "^browserName$", @@ -39,7 +39,6 @@ public class AcceptedW3CCapabilityKeys implements Predicate { .map(Pattern::asPredicate) .reduce(identity -> false, Predicate::or); - @Override public boolean test(String capabilityName) { return ACCEPTED_W3C_PATTERNS.test(capabilityName); diff --git a/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java b/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java index 8e517a90640ff..317b1bc00e103 100644 --- a/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java +++ b/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java @@ -45,7 +45,7 @@ public class HttpCommandExecutor implements CommandExecutor, NeedsLocalLogs { - private final static HttpClient.Factory defaultClientFactory = HttpClient.Factory.createDefault(); + private static final HttpClient.Factory defaultClientFactory = HttpClient.Factory.createDefault(); private final URL remoteServer; private final HttpClient client; diff --git a/java/client/src/org/openqa/selenium/remote/NewSessionPayload.java b/java/client/src/org/openqa/selenium/remote/NewSessionPayload.java index f6ab8acf61087..03ebb25428f64 100644 --- a/java/client/src/org/openqa/selenium/remote/NewSessionPayload.java +++ b/java/client/src/org/openqa/selenium/remote/NewSessionPayload.java @@ -82,7 +82,7 @@ public class NewSessionPayload implements Closeable { private final Set transforms; private static final Dialect DEFAULT_DIALECT = Dialect.OSS; - private final static Predicate ACCEPTED_W3C_PATTERNS = new AcceptedW3CCapabilityKeys(); + private static final Predicate ACCEPTED_W3C_PATTERNS = new AcceptedW3CCapabilityKeys(); private final Json json = new Json(); private final FileBackedOutputStream backingStore; diff --git a/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java b/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java index 8d8f62dc147d2..0c8b4e91d5aaa 100644 --- a/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java +++ b/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java @@ -54,7 +54,7 @@ public class ProtocolHandshake { - private final static Logger LOG = Logger.getLogger(ProtocolHandshake.class.getName()); + private static final Logger LOG = Logger.getLogger(ProtocolHandshake.class.getName()); public Result createSession(HttpClient client, Command command) throws IOException { diff --git a/java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java b/java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java index 77275adb71646..73fab9797dd4c 100644 --- a/java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java +++ b/java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java @@ -84,11 +84,12 @@ @Beta public class RemoteWebDriverBuilder { - private final static Set ILLEGAL_METADATA_KEYS = ImmutableSet.of( + private static final Set ILLEGAL_METADATA_KEYS = ImmutableSet.of( "alwaysMatch", "capabilities", "firstMatch"); - private final static AcceptedW3CCapabilityKeys OK_KEYS = new AcceptedW3CCapabilityKeys(); + private static final AcceptedW3CCapabilityKeys OK_KEYS = new AcceptedW3CCapabilityKeys(); + private final List> options = new ArrayList<>(); private final Map metadata = new TreeMap<>(); private final Map additionalCapabilities = new TreeMap<>(); diff --git a/java/client/src/org/openqa/selenium/remote/http/UrlTemplate.java b/java/client/src/org/openqa/selenium/remote/http/UrlTemplate.java index dfc7b1c618339..f54766c105585 100644 --- a/java/client/src/org/openqa/selenium/remote/http/UrlTemplate.java +++ b/java/client/src/org/openqa/selenium/remote/http/UrlTemplate.java @@ -30,7 +30,7 @@ */ public class UrlTemplate { - private final static Pattern GROUP_NAME = Pattern.compile("\\(\\?<([a-zA-Z][a-zA-Z0-9]*)>"); + private static final Pattern GROUP_NAME = Pattern.compile("\\(\\?<([a-zA-Z][a-zA-Z0-9]*)>"); private final List template; public UrlTemplate(String template) { diff --git a/java/client/src/org/openqa/selenium/remote/http/netty/NettyClient.java b/java/client/src/org/openqa/selenium/remote/http/netty/NettyClient.java index 19701f910d63f..545d0b4cb8123 100644 --- a/java/client/src/org/openqa/selenium/remote/http/netty/NettyClient.java +++ b/java/client/src/org/openqa/selenium/remote/http/netty/NettyClient.java @@ -32,7 +32,7 @@ public class NettyClient implements HttpClient { - private final static AsyncHttpClient httpClient = Dsl.asyncHttpClient(); + private static final AsyncHttpClient httpClient = Dsl.asyncHttpClient(); private final HttpHandler handler; private BiFunction toWebSocket; diff --git a/java/client/src/org/openqa/selenium/remote/service/DriverService.java b/java/client/src/org/openqa/selenium/remote/service/DriverService.java index 46143a9cbfdb9..b79065214e884 100644 --- a/java/client/src/org/openqa/selenium/remote/service/DriverService.java +++ b/java/client/src/org/openqa/selenium/remote/service/DriverService.java @@ -294,7 +294,7 @@ protected OutputStream getOutputStream() { return outputStream; } - public static abstract class Builder> { + public abstract static class Builder> { private int port = 0; private File exe = null; diff --git a/java/client/src/org/openqa/selenium/support/Color.java b/java/client/src/org/openqa/selenium/support/Color.java index 75ae70d02ad87..e27f6708f7c47 100644 --- a/java/client/src/org/openqa/selenium/support/Color.java +++ b/java/client/src/org/openqa/selenium/support/Color.java @@ -121,7 +121,7 @@ public int hashCode() { return result; } - private static abstract class Converter { + private abstract static class Converter { public Color getColor(String value) { Matcher matcher = getPattern().matcher(value); if (matcher.find()) { diff --git a/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java b/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java index 5f2cb495eb338..9b0734aa4ffa5 100644 --- a/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java +++ b/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java @@ -42,7 +42,7 @@ */ public class ExpectedConditions { - private final static Logger log = Logger.getLogger(ExpectedConditions.class.getName()); + private static final Logger log = Logger.getLogger(ExpectedConditions.class.getName()); private ExpectedConditions() { // Utility class diff --git a/java/client/src/org/openqa/selenium/support/ui/FluentWait.java b/java/client/src/org/openqa/selenium/support/ui/FluentWait.java index cf6fd3d90cc36..780ea4b087c75 100644 --- a/java/client/src/org/openqa/selenium/support/ui/FluentWait.java +++ b/java/client/src/org/openqa/selenium/support/ui/FluentWait.java @@ -71,7 +71,7 @@ */ public class FluentWait implements Wait { - protected final static long DEFAULT_SLEEP_TIMEOUT = 500; + protected static final long DEFAULT_SLEEP_TIMEOUT = 500; private static final Duration DEFAULT_WAIT_DURATION = Duration.ofMillis(DEFAULT_SLEEP_TIMEOUT); diff --git a/java/server/src/org/openqa/selenium/grid/web/ProtocolConverter.java b/java/server/src/org/openqa/selenium/grid/web/ProtocolConverter.java index 7bbabe9635a54..136a1dca87959 100644 --- a/java/server/src/org/openqa/selenium/grid/web/ProtocolConverter.java +++ b/java/server/src/org/openqa/selenium/grid/web/ProtocolConverter.java @@ -58,8 +58,8 @@ public class ProtocolConverter implements HttpHandler { - private final static Json JSON = new Json(); - private final static ImmutableSet IGNORED_REQ_HEADERS = ImmutableSet.builder() + private static final Json JSON = new Json(); + private static final ImmutableSet IGNORED_REQ_HEADERS = ImmutableSet.builder() .add("connection") .add("content-length") .add("content-type") diff --git a/java/server/src/org/openqa/selenium/grid/web/ReverseProxyHandler.java b/java/server/src/org/openqa/selenium/grid/web/ReverseProxyHandler.java index 8a4cf9ab58f32..8a884e52d8dfc 100644 --- a/java/server/src/org/openqa/selenium/grid/web/ReverseProxyHandler.java +++ b/java/server/src/org/openqa/selenium/grid/web/ReverseProxyHandler.java @@ -34,9 +34,9 @@ public class ReverseProxyHandler implements HttpHandler { - private final static Logger LOG = Logger.getLogger(ReverseProxyHandler.class.getName()); + private static final Logger LOG = Logger.getLogger(ReverseProxyHandler.class.getName()); - private final static ImmutableSet IGNORED_REQ_HEADERS = ImmutableSet.builder() + private static final ImmutableSet IGNORED_REQ_HEADERS = ImmutableSet.builder() .add("connection") .add("keep-alive") .add("proxy-authorization") diff --git a/java/server/src/org/openqa/selenium/remote/server/ActiveSessionFactory.java b/java/server/src/org/openqa/selenium/remote/server/ActiveSessionFactory.java index 4829331035142..8b16a016822ca 100644 --- a/java/server/src/org/openqa/selenium/remote/server/ActiveSessionFactory.java +++ b/java/server/src/org/openqa/selenium/remote/server/ActiveSessionFactory.java @@ -56,9 +56,9 @@ */ public class ActiveSessionFactory implements SessionFactory { - private final static Logger LOG = Logger.getLogger(ActiveSessionFactory.class.getName()); + private static final Logger LOG = Logger.getLogger(ActiveSessionFactory.class.getName()); - private final static Function> CLASS_EXISTS = name -> { + private static final Function> CLASS_EXISTS = name -> { try { return Class.forName(name); } catch (ClassNotFoundException | NoClassDefFoundError e) { diff --git a/java/server/src/org/openqa/selenium/remote/server/ActiveSessions.java b/java/server/src/org/openqa/selenium/remote/server/ActiveSessions.java index 3a37c9cbb4391..53a739024ef89 100644 --- a/java/server/src/org/openqa/selenium/remote/server/ActiveSessions.java +++ b/java/server/src/org/openqa/selenium/remote/server/ActiveSessions.java @@ -38,7 +38,7 @@ * All current {@link ActiveSession}s that we're aware of. */ public class ActiveSessions { - private final static Logger LOG = Logger.getLogger(ActiveSessions.class.getName()); + private static final Logger LOG = Logger.getLogger(ActiveSessions.class.getName()); private final Cache allSessions; private final List listeners = new LinkedList<>(); diff --git a/java/server/src/org/openqa/selenium/remote/server/commandhandler/ExceptionHandler.java b/java/server/src/org/openqa/selenium/remote/server/commandhandler/ExceptionHandler.java index 60ac432b89b62..d5c060fd97653 100644 --- a/java/server/src/org/openqa/selenium/remote/server/commandhandler/ExceptionHandler.java +++ b/java/server/src/org/openqa/selenium/remote/server/commandhandler/ExceptionHandler.java @@ -43,8 +43,8 @@ */ public class ExceptionHandler implements HttpHandler { - private final static ErrorCodes ERRORS = new ErrorCodes(); - private final static Json toJson = new Json(); + private static final ErrorCodes ERRORS = new ErrorCodes(); + private static final Json toJson = new Json(); private final Throwable exception; diff --git a/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java b/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java index b276c10d73319..fb4a65b5599ea 100644 --- a/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java +++ b/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java @@ -264,7 +264,7 @@ public void configureLogging(LoggingPreferences prefs) { } @Override - synchronized public void publish(LogRecord record) { + public synchronized void publish(LogRecord record) { ThreadKey threadId = new ThreadKey(); SessionId sessionId = threadToSessionMap.get(threadId); diff --git a/java/server/src/org/openqa/selenium/remote/server/log/SessionLogsToFileRepository.java b/java/server/src/org/openqa/selenium/remote/server/log/SessionLogsToFileRepository.java index 3b95cd763cf06..fba665a6ec6d5 100644 --- a/java/server/src/org/openqa/selenium/remote/server/log/SessionLogsToFileRepository.java +++ b/java/server/src/org/openqa/selenium/remote/server/log/SessionLogsToFileRepository.java @@ -64,7 +64,7 @@ public void createLogFileAndAddToMap(SessionId sessionId) throws IOException { * @param records logRecords that need to be stored * @throws IOException file i/o exception can occur because of a temp file created */ - synchronized public void flushRecordsToLogFile(SessionId sessionId, + public synchronized void flushRecordsToLogFile(SessionId sessionId, List records) throws IOException { LogFile logFile = sessionToLogFileMap.get(sessionId);