@@ -167,7 +167,7 @@ public void submit() {
167167 submitForm ((HtmlForm ) element );
168168 return ;
169169 } else if ((element instanceof HtmlSubmitInput ) || (element instanceof HtmlImageInput )) {
170- (( HtmlElement ) element ) .click ();
170+ element .click ();
171171 return ;
172172 } else if (element instanceof HtmlInput ) {
173173 HtmlForm form = ((HtmlElement ) element ).getEnclosingForm ();
@@ -263,7 +263,7 @@ public void clear() {
263263 throw new InvalidElementStateException ("You may only interact with enabled elements" );
264264 }
265265 htmlTextArea .setText ("" );
266- } else if (element .getAttribute ("contenteditable" ) != DomElement .ATTRIBUTE_NOT_DEFINED ) {
266+ } else if (! element .getAttribute ("contenteditable" ). equals ( DomElement .ATTRIBUTE_NOT_DEFINED ) ) {
267267 element .setTextContent ("" );
268268 }
269269 }
@@ -278,7 +278,7 @@ public Boolean call() throws Exception {
278278 }
279279 });
280280
281- if (displayed == null || !displayed . booleanValue () ) {
281+ if (displayed == null || !displayed ) {
282282 throw new ElementNotVisibleException ("You may only interact with visible elements" );
283283 }
284284
@@ -298,12 +298,12 @@ private void switchFocusToThisIfNeeded() {
298298 if (jsEnabled &&
299299 !oldActiveEqualsCurrent &&
300300 !isBody ) {
301- (( HtmlElement ) oldActiveElement .element ) .blur ();
301+ oldActiveElement .element .blur ();
302302 }
303303 } catch (StaleElementReferenceException ex ) {
304304 // old element has gone, do nothing
305305 }
306- (( HtmlElement ) element ) .focus ();
306+ element .focus ();
307307 }
308308
309309 void sendKeyDownEvent (CharSequence modifierKey ) {
@@ -683,7 +683,7 @@ public WebElement findElementByCssSelector(String using) {
683683 }
684684
685685 private List <WebElement > findChildNodes (List <WebElement > allElements ) {
686- List <WebElement > toReturn = new LinkedList <WebElement >();
686+ List <WebElement > toReturn = new LinkedList <>();
687687
688688 for (WebElement current : allElements ) {
689689 DomElement candidate = ((HtmlUnitWebElement ) current ).element ;
@@ -766,7 +766,7 @@ public List<WebElement> findElementsByLinkText(String linkText) {
766766 assertElementNotStale ();
767767
768768 String expectedText = linkText .trim ();
769- List <? extends DomElement > htmlElements = ((HtmlElement ) element ).getHtmlElementsByTagName ("a" );
769+ List <? extends HtmlElement > htmlElements = ((HtmlElement ) element ).getHtmlElementsByTagName ("a" );
770770 List <WebElement > webElements = new ArrayList <>();
771771 for (DomElement e : htmlElements ) {
772772 if (expectedText .equals (e .getTextContent ().trim ()) && e .getAttribute ("href" ) != null ) {
0 commit comments