From f3f0ae34e3c5b5528fae12ac123b8c77aaef1f13 Mon Sep 17 00:00:00 2001 From: User253489 Date: Thu, 30 Nov 2017 22:43:28 -0500 Subject: [PATCH 1/6] Fix issues in Javadocs and exception messages. --- java/client/src/org/openqa/selenium/By.java | 66 ++++++++++----------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/java/client/src/org/openqa/selenium/By.java b/java/client/src/org/openqa/selenium/By.java index 8142205a9b10c..c93190684ee57 100644 --- a/java/client/src/org/openqa/selenium/By.java +++ b/java/client/src/org/openqa/selenium/By.java @@ -45,105 +45,105 @@ */ public abstract class By { /** - * @param id The value of the "id" attribute to search for - * @return a By which locates elements by the value of the "id" attribute. + * @param id The value of the "id" attribute to search for. + * @return A By which locates elements by the value of the "id" attribute. */ public static By id(final String id) { if (id == null) throw new IllegalArgumentException( - "Cannot find elements with a null id attribute."); + "Cannot find elements when the id is null."); return new ById(id); } /** - * @param linkText The exact text to match against - * @return a By which locates A elements by the exact text it displays + * @param linkText The exact text to match against. + * @return A By which locates A elements by the exact text they display. */ public static By linkText(final String linkText) { if (linkText == null) throw new IllegalArgumentException( - "Cannot find elements when link text is null."); + "Cannot find elements when the link text is null."); return new ByLinkText(linkText); } /** - * @param linkText The text to match against - * @return a By which locates A elements that contain the given link text + * @param linkText The text to match against. + * @return A By which locates A elements that contain the given text. */ public static By partialLinkText(final String linkText) { if (linkText == null) throw new IllegalArgumentException( - "Cannot find elements when link text is null."); + "Cannot find elements when the link text is null."); return new ByPartialLinkText(linkText); } /** - * @param name The value of the "name" attribute to search for - * @return a By which locates elements by the value of the "name" attribute. + * @param name The value of the "name" attribute to search for. + * @return A By which locates elements by the value of the "name" attribute. */ public static By name(final String name) { if (name == null) throw new IllegalArgumentException( - "Cannot find elements when name text is null."); + "Cannot find elements when the name is null."); return new ByName(name); } /** - * @param name The element's tagName - * @return a By which locates elements by their tag name + * @param name The element's tag name. + * @return A By which locates elements by their tag name. */ public static By tagName(final String name) { if (name == null) throw new IllegalArgumentException( - "Cannot find elements when name tag name is null."); + "Cannot find elements when the tag name is null."); return new ByTagName(name); } /** - * @param xpathExpression The xpath to use - * @return a By which locates elements via XPath + * @param xpathExpression The XPath to use. + * @return A By which locates elements via XPath. */ public static By xpath(final String xpathExpression) { if (xpathExpression == null) throw new IllegalArgumentException( - "Cannot find elements when the XPath expression is null."); + "Cannot find elements when the XPath is null."); return new ByXPath(xpathExpression); } /** - * Finds elements based on the value of the "class" attribute. If an element has many classes then - * this will match against each of them. For example if the value is "one two onone", then the - * following "className"s will match: "one" and "two" + * Find elements based on the value of the "class" attribute. If an element has multiple classes, then + * this will match against each of them. For example, if the value is "one two onone", then the + * class names "one" and "two" will match. * - * @param className The value of the "class" attribute to search for - * @return a By which locates elements by the value of the "class" attribute. + * @param className The value of the "class" attribute to search for. + * @return A By which locates elements by the value of the "class" attribute. */ public static By className(final String className) { if (className == null) throw new IllegalArgumentException( - "Cannot find elements when the class name expression is null."); + "Cannot find elements when the class name is null."); return new ByClassName(className); } /** - * Finds elements via the driver's underlying W3 Selector engine. If the browser does not + * Find elements via the driver's underlying W3 Selector engine. If the browser does not * implement the Selector API, a best effort is made to emulate the API. In this case, we strive * for at least CSS2 support, but offer no guarantees. * - * @param selector css expression - * @return a By which locates elements by CSS. + * @param selector CSS expression. + * @return A By which locates elements by CSS. */ public static By cssSelector(final String selector) { if (selector == null) throw new IllegalArgumentException( - "Cannot find elements when the selector is null"); + "Cannot find elements when the CSS selector is null."); return new ByCssSelector(selector); @@ -152,8 +152,8 @@ public static By cssSelector(final String selector) { /** * Find a single element. Override this method if necessary. * - * @param context A context to use to find the element - * @return The WebElement that matches the selector + * @param context A context to use to find the element. + * @return The WebElement that matches the selector. */ public WebElement findElement(SearchContext context) { List allElements = findElements(context); @@ -166,8 +166,8 @@ public WebElement findElement(SearchContext context) { /** * Find many elements. * - * @param context A context to use to find the element - * @return A list of WebElements matching the selector + * @param context A context to use to find the elements. + * @return A list of WebElements matching the selector. */ public abstract List findElements(SearchContext context); @@ -394,7 +394,7 @@ public WebElement findElement(SearchContext context) { } /** - * Generates a partial xpath expression that matches an element whose specified attribute + * Generate a partial XPath expression that matches an element whose specified attribute * contains the given CSS word. So to match <div class='foo bar'> you would say "//div[" + * containingWord("class", "foo") + "]". * From 4e3c3b301ad936606847cbc0bc83620977deab0f Mon Sep 17 00:00:00 2001 From: User253489 Date: Thu, 8 Feb 2018 17:04:26 -0500 Subject: [PATCH 2/6] Fix Javadoc issues. --- java/client/src/org/openqa/selenium/ContextAware.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/client/src/org/openqa/selenium/ContextAware.java b/java/client/src/org/openqa/selenium/ContextAware.java index 0069671418388..08e961cf40771 100644 --- a/java/client/src/org/openqa/selenium/ContextAware.java +++ b/java/client/src/org/openqa/selenium/ContextAware.java @@ -37,7 +37,7 @@ public interface ContextAware { /** * Return a set of context handles which can be used to iterate over all contexts of this - * WebDriver instance + * WebDriver instance. * * @return A set of context handles which can be used to iterate over available contexts. */ @@ -45,9 +45,9 @@ public interface ContextAware { /** * Return an opaque handle to this context that uniquely identifies it within this driver - * instance. This can be used to switch to this context at a later date + * instance. This can be used to switch to this context at a later date. * - * @return The current context handle + * @return The current context handle. */ String getContext(); } From 3f5666cfafd0fc50d244425df56c21813116783d Mon Sep 17 00:00:00 2001 From: User253489 Date: Sat, 31 Mar 2018 19:18:05 -0400 Subject: [PATCH 3/6] Fix issues in comments and exception messages. --- java/client/src/org/openqa/selenium/Capabilities.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/client/src/org/openqa/selenium/Capabilities.java b/java/client/src/org/openqa/selenium/Capabilities.java index ca8fbb287e993..d3bec11cb5535 100644 --- a/java/client/src/org/openqa/selenium/Capabilities.java +++ b/java/client/src/org/openqa/selenium/Capabilities.java @@ -48,7 +48,7 @@ default Platform getPlatform() { return (Platform) rawPlatform; } - throw new IllegalStateException("Platform was neither a string or a Platform: " + rawPlatform); + throw new IllegalStateException("Platform was neither a string nor a Platform: " + rawPlatform); } default String getVersion() { @@ -57,7 +57,7 @@ default String getVersion() { } /** - * @deprecated Use is(SUPPORTS_JAVASCRIPT) instead + * @deprecated Use is(SUPPORTS_JAVASCRIPT) instead. * @see #is(String) * @see org.openqa.selenium.remote.CapabilityType#SUPPORTS_JAVASCRIPT */ @@ -67,7 +67,7 @@ default boolean isJavascriptEnabled() { } /** - * @return The capabilities as a Map + * @return The capabilities as a Map. */ Map asMap(); @@ -86,7 +86,7 @@ default boolean isJavascriptEnabled() { default boolean is(String capabilityName) { Object cap = getCapability(capabilityName); if (cap == null) { - // javascriptEnabled is true if not set explicitly + // If it's not set explicitly, javascriptEnabled is true. return "javascriptEnabled".equals(capabilityName); } return cap instanceof Boolean ? (Boolean) cap : Boolean.parseBoolean(String.valueOf(cap)); From c9ef1291a411da629b89a8b24d067e028ddf1696 Mon Sep 17 00:00:00 2001 From: User253489 Date: Sun, 8 Apr 2018 20:26:51 -0400 Subject: [PATCH 4/6] Fix comment issues. --- .../src/org/openqa/selenium/DeviceRotation.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/java/client/src/org/openqa/selenium/DeviceRotation.java b/java/client/src/org/openqa/selenium/DeviceRotation.java index fa7a4605c3856..507799f928068 100644 --- a/java/client/src/org/openqa/selenium/DeviceRotation.java +++ b/java/client/src/org/openqa/selenium/DeviceRotation.java @@ -24,13 +24,13 @@ /** * Defines an object which represents the three dimensional plane and how a device can be rotated - * about it. Each of the axis is in positive degrees on the real number scale (0 <= deg <= + * about it. Each of the axes is in positive degrees on the real number scale (0 <= deg <= * 360). * - *

Example Instantiation to rotate device to "Landscape Right": DeviceRotation(0, 0, 90); + *

Example instantiation to rotate device to "Landscape Right": DeviceRotation(0, 0, 90); */ public class DeviceRotation { - //Default orientation is portrait + // The default orientation is portrait. private int x = 0; private int y = 0; private int z = 0; @@ -46,7 +46,7 @@ public DeviceRotation(int x, int y, int z) { } /** - * Instantiate a DeviceRotation object based on a HashMap object where the keys are the axis x, y, + * Instantiate a DeviceRotation object based on a HashMap object where the keys are the axes x, y, * and z respectively: x : xVal y : yVal z : zVal */ public DeviceRotation(Map map) { @@ -75,22 +75,22 @@ private void validateParameters(int x, int y, int z) { } } - /** @return the x */ + /** @return The x. */ public int getX() { return x; } - /** @return the y */ + /** @return The y. */ public int getY() { return y; } - /** @return the z */ + /** @return The z. */ public int getZ() { return z; } - /** @return returns all axis mapped to a Map */ + /** @return All axes mapped to a Map. */ public Map parameters() { HashMap values = new HashMap<>(); values.put("x", this.x); From 31b80a32ab32680fd53629f728e095ff204a7fa5 Mon Sep 17 00:00:00 2001 From: User253489 Date: Tue, 29 May 2018 15:13:08 -0400 Subject: [PATCH 5/6] Fix comment issues. --- .../client/src/org/openqa/selenium/MutableCapabilities.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/client/src/org/openqa/selenium/MutableCapabilities.java b/java/client/src/org/openqa/selenium/MutableCapabilities.java index 32694a9649cde..837c4f859c54f 100644 --- a/java/client/src/org/openqa/selenium/MutableCapabilities.java +++ b/java/client/src/org/openqa/selenium/MutableCapabilities.java @@ -57,12 +57,12 @@ public MutableCapabilities(Map capabilities) { } /** - * Merges the extra capabilities provided into this DesiredCapabilities instance. If capabilities + * Merge the extra capabilities provided into this DesiredCapabilities instance. If capabilities * with the same name exist in this instance, they will be overridden by the values from the * extraCapabilities object. * * @param extraCapabilities Additional capabilities to be added. - * @return DesiredCapabilities after the merge + * @return The DesiredCapabilities instance after the merge. */ @Override public MutableCapabilities merge(Capabilities extraCapabilities) { @@ -89,7 +89,7 @@ public void setCapability(String capabilityName, Platform value) { public void setCapability(String key, Object value) { // We have to special-case some keys and values because of the popular idiom of calling - // something like "capabilities.setCapability(SafariOptions.CAPABILITY, new SafariOptions()); + // something like "capabilities.setCapability(SafariOptions.CAPABILITY, new SafariOptions());" // and this is no longer needed as options are capabilities. There will be a large amount of // legacy code that will always try and follow this pattern, however. if (OPTION_KEYS.contains(key) && value instanceof Capabilities) { From b784b0e10b9768589c6e78679244bea7f24a67a0 Mon Sep 17 00:00:00 2001 From: User253489 Date: Mon, 1 Oct 2018 19:38:35 -0400 Subject: [PATCH 6/6] Fix Javadoc comment issues. --- java/client/src/org/openqa/selenium/chrome/ChromeDriver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/client/src/org/openqa/selenium/chrome/ChromeDriver.java b/java/client/src/org/openqa/selenium/chrome/ChromeDriver.java index fe98620418a1c..26320e757d085 100644 --- a/java/client/src/org/openqa/selenium/chrome/ChromeDriver.java +++ b/java/client/src/org/openqa/selenium/chrome/ChromeDriver.java @@ -136,7 +136,7 @@ public ChromeDriver(ChromeDriverService service) { /** * Creates a new ChromeDriver instance. The {@code capabilities} will be passed to the - * chromedriver service. + * ChromeDriver service. * * @param capabilities The capabilities required from the ChromeDriver. * @see #ChromeDriver(ChromeDriverService, Capabilities) @@ -230,7 +230,7 @@ public ConnectionType setNetworkConnection(ConnectionType type) { /** * Launches Chrome app specified by id. * - * @param id chrome app id + * @param id Chrome app id. */ public void launchApp(String id) { execute(ChromeDriverCommand.LAUNCH_APP, ImmutableMap.of("id", id));