Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion java/src/org/openqa/selenium/support/ui/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ java_library(
":clock",
"//java/src/org/openqa/selenium:core",
"//java/src/org/openqa/selenium/remote",
artifact("com.google.guava:guava"),
artifact("org.jspecify:jspecify"),
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.openqa.selenium.support.ui;

import com.google.common.base.Function;
import java.util.function.Function;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import org.openqa.selenium.WebDriver;
Expand All @@ -37,5 +37,4 @@
// such as "com.google.common.base.Function condition = ExpectedConditions.elementFound(By);"
// breaking at compile time, we continue to extend Guava's Function interface.
@NullMarked
public interface ExpectedCondition<T extends @Nullable Object>
extends Function<WebDriver, T>, java.util.function.Function<WebDriver, T> {}
public interface ExpectedCondition<T extends @Nullable Object> extends Function<WebDriver, T> {}
13 changes: 6 additions & 7 deletions java/src/org/openqa/selenium/support/ui/ExpectedConditions.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

package org.openqa.selenium.support.ui;

import com.google.common.base.Joiner;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import org.openqa.selenium.Alert;
Expand Down Expand Up @@ -1421,9 +1422,8 @@ public Boolean apply(WebDriver driver) {

@Override
public String toString() {
StringBuilder message = new StringBuilder("at least one condition to be valid: ");
Joiner.on(" || ").appendTo(message, conditions);
return message.toString();
return "at least one condition to be valid: "
+ Arrays.stream(conditions).map(Objects::toString).collect(Collectors.joining(" || "));
}
};
}
Expand Down Expand Up @@ -1458,9 +1458,8 @@ public Boolean apply(WebDriver driver) {

@Override
public String toString() {
StringBuilder message = new StringBuilder("all conditions to be valid: ");
Joiner.on(" && ").appendTo(message, conditions);
return message.toString();
return "all conditions to be valid: "
+ Arrays.stream(conditions).map(Objects::toString).collect(Collectors.joining(" && "));
}
};
}
Expand Down
Loading