diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2021-07-08 12:04:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-08 12:04:58 +0300 |
commit | 3afe45849edc79f0e7b371a7fd3ef209292dce79 (patch) | |
tree | 2934d3ca30286b3480d7c6b4c5d5bfc99aa196db /testbench-api/src/main/java/com/vaadin/testbench | |
parent | 347d36dcbccb07f1dd46f17ea5be6fceecc755cb (diff) | |
download | vaadin-framework-3afe45849edc79f0e7b371a7fd3ef209292dce79.tar.gz vaadin-framework-3afe45849edc79f0e7b371a7fd3ef209292dce79.zip |
Code cleanup (#12333)
- removed unused private methods
- removed unused private variables
- removed unnecessary initializations
- removed unnecessary substring(0)
- removed inner assignments
- renamed private methods that started with upper case
- renamed static final variables to use upper case
- converted to use non-deprecated options
- suppressed unavoidable warnings
- divided long Strings to multiple lines
- added missing types
- added missing JavaDoc parameters
- formatting
- updated comments & JavaDocs
Diffstat (limited to 'testbench-api/src/main/java/com/vaadin/testbench')
-rw-r--r-- | testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java index 99f77237ab..0c19c2a160 100644 --- a/testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java +++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java @@ -34,9 +34,7 @@ public class AbstractComponentElement extends AbstractElement { */ public String getCaption() { final String gwtIdAttribute = "aria-labelledby"; - WebElement captElem = null; - String captionId = null; - captionId = getAttribute(gwtIdAttribute); + String captionId = getAttribute(gwtIdAttribute); // IE8 getAttribute returns empty string instead of null // when there is no attribute with specified name if (captionId == null || captionId.isEmpty()) { @@ -45,7 +43,7 @@ public class AbstractComponentElement extends AbstractElement { captionId = elem.getAttribute(gwtIdAttribute); } // element ids are unique, we can search the whole page - captElem = getDriver().findElement(By.id(captionId)); + WebElement captElem = getDriver().findElement(By.id(captionId)); return captElem.getText(); } |