File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed
java/src/org/openqa/selenium Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ public static By cssSelector(String cssSelector) {
121121 public WebElement findElement (SearchContext context ) {
122122 List <WebElement > allElements = findElements (context );
123123 if (allElements == null || allElements .isEmpty ()) {
124- throw new NoSuchElementException ("Cannot locate an element using " + toString () );
124+ throw new NoSuchElementException ("Cannot locate an element using " + this );
125125 }
126126 return allElements .get (0 );
127127 }
Original file line number Diff line number Diff line change 1717
1818package org .openqa .selenium ;
1919
20- import java .util .Collections ;
2120import java .util .Set ;
2221import java .util .stream .Collectors ;
2322import org .jspecify .annotations .NullMarked ;
@@ -177,10 +176,9 @@ default void unpin(ScriptKey key) {
177176 * @return The {@link ScriptKey}s of all currently pinned scripts.
178177 */
179178 default Set <ScriptKey > getPinnedScripts () {
180- return Collections .unmodifiableSet (
181- UnpinnedScriptKey .getPinnedScripts (this ).stream ()
182- .map (key -> (ScriptKey ) key )
183- .collect (Collectors .toSet ()));
179+ return UnpinnedScriptKey .getPinnedScripts (this ).stream ()
180+ .map (key -> (ScriptKey ) key )
181+ .collect (Collectors .toUnmodifiableSet ());
184182 }
185183
186184 /**
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public WebElement findElement(SearchContext context) {
5454 return elements .get (0 );
5555 }
5656 }
57- throw new NoSuchElementException ("Cannot locate an element using " + toString () );
57+ throw new NoSuchElementException ("Cannot locate an element using " + this );
5858 }
5959
6060 @ Override
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public ByChained(By... bys) {
5252 public WebElement findElement (SearchContext context ) {
5353 List <WebElement > elements = findElements (context );
5454 if (elements .isEmpty ())
55- throw new NoSuchElementException ("Cannot locate an element using " + toString () );
55+ throw new NoSuchElementException ("Cannot locate an element using " + this );
5656 return elements .get (0 );
5757 }
5858
You can’t perform that action at this time.
0 commit comments