Skip to content

Commit

Permalink
[java] Reordering modifiers as recommended by linter to match Java La…
Browse files Browse the repository at this point in the history
…nguage Specification, no functional changes
  • Loading branch information
barancev committed Apr 26, 2020
1 parent 076d1ba commit e81d3ed
Show file tree
Hide file tree
Showing 36 changed files with 70 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> additionalLocators = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, SeleneseCommand<?>> seleneseMethods = new HashMap<>();
private final String baseUrl;
private final Timer timer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
import java.util.logging.Logger;

public class AttachFile extends SeleneseCommand<Void> {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.util.logging.Logger;

public class Type extends SeleneseCommand<Void> {
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;
Expand Down
6 changes: 3 additions & 3 deletions java/client/src/org/openqa/selenium/WebDriverException.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> extraInfo = new HashMap<>();
private final Map<String, String> extraInfo = new HashMap<>();

public WebDriverException() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public EdgeDriverService(
unmodifiableMap(new HashMap<>(environment)));
}

public static abstract class Builder<DS extends EdgeDriverService, B extends EdgeDriverService.Builder<?, ?>>
public abstract static class Builder<DS extends EdgeDriverService, B extends EdgeDriverService.Builder<?, ?>>
extends DriverService.Builder<DS, B> {

public abstract boolean isLegacy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public enum FirefoxDriverLogLevel {
ERROR,
FATAL;

private final static Map<Level, FirefoxDriverLogLevel> logLevelToGeckoLevelMap
private static final Map<Level, FirefoxDriverLogLevel> logLevelToGeckoLevelMap
= new ImmutableMap.Builder<Level, FirefoxDriverLogLevel>()
.put(Level.ALL, TRACE)
.put(Level.FINEST, TRACE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*/
public class FirefoxOptions extends AbstractDriverOptions<FirefoxOptions> {

public final static String FIREFOX_OPTIONS = "moz:firefoxOptions";
public static final String FIREFOX_OPTIONS = "moz:firefoxOptions";

private List<String> args = new ArrayList<>();
private Map<String, Object> preferences = new HashMap<>();
Expand Down
40 changes: 20 additions & 20 deletions java/client/src/org/openqa/selenium/ie/InternetExplorerDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,111 +32,111 @@ 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
* protected mode settings during starting by IEDriverServer.
*
* 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class InternetExplorerOptions extends AbstractDriverOptions<InternetExplo
private static final String FORCE_WINDOW_SHELL_API = "ie.forceShellWindowsApi";
private static final String VALIDATE_COOKIE_DOCUMENT_TYPE = "ie.validateCookieDocumentType";

private final static List<String> CAPABILITY_NAMES = Arrays.asList(
private static final List<String> CAPABILITY_NAMES = Arrays.asList(
BROWSER_ATTACH_TIMEOUT,
ELEMENT_SCROLL_BEHAVIOR,
ENABLE_PERSISTENT_HOVERING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

class NumberCoercer<T extends Number> extends TypeCoercer<T> {

private final static Map<Class<?>, Class<?>> PRIMITIVE_NUMBER_TYPES;
private static final Map<Class<?>, Class<?>> PRIMITIVE_NUMBER_TYPES;
static {
Map<Class<?>, Class<?>> builder = new HashMap<>();
builder.put(byte.class, Byte.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class SimplePropertyDescriptor {

private final static Function<Object, Object> GET_CLASS_NAME = obj -> {
private static final Function<Object, Object> GET_CLASS_NAME = obj -> {
if (obj == null) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions java/client/src/org/openqa/selenium/net/HostIdentifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class AcceptedW3CCapabilityKeys implements Predicate<String> {

private final static Predicate<String> ACCEPTED_W3C_PATTERNS = Stream.of(
private static final Predicate<String> ACCEPTED_W3C_PATTERNS = Stream.of(
"^[\\w-]+:.*$",
"^acceptInsecureCerts$",
"^browserName$",
Expand All @@ -39,7 +39,6 @@ public class AcceptedW3CCapabilityKeys implements Predicate<String> {
.map(Pattern::asPredicate)
.reduce(identity -> false, Predicate::or);


@Override
public boolean test(String capabilityName) {
return ACCEPTED_W3C_PATTERNS.test(capabilityName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class NewSessionPayload implements Closeable {
private final Set<CapabilityTransform> transforms;

private static final Dialect DEFAULT_DIALECT = Dialect.OSS;
private final static Predicate<String> ACCEPTED_W3C_PATTERNS = new AcceptedW3CCapabilityKeys();
private static final Predicate<String> ACCEPTED_W3C_PATTERNS = new AcceptedW3CCapabilityKeys();

private final Json json = new Json();
private final FileBackedOutputStream backingStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@
@Beta
public class RemoteWebDriverBuilder {

private final static Set<String> ILLEGAL_METADATA_KEYS = ImmutableSet.of(
private static final Set<String> 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<Map<String, Object>> options = new ArrayList<>();
private final Map<String, Object> metadata = new TreeMap<>();
private final Map<String, Object> additionalCapabilities = new TreeMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Matches> template;

public UrlTemplate(String template) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<HttpRequest, WebSocket.Listener, WebSocket> toWebSocket;
Expand Down
Loading

0 comments on commit e81d3ed

Please sign in to comment.