Skip to content

Commit fcf4c9d

Browse files
committed
[java] Removing deprecated SlowLoadableComponent constructor
1 parent 1e65b7b commit fcf4c9d

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

java/src/org/openqa/selenium/support/pagefactory/AjaxElementLocator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import java.lang.reflect.Field;
2121
import java.time.Clock;
22+
import java.time.Duration;
2223
import java.util.ArrayList;
2324
import java.util.List;
2425
import org.openqa.selenium.NoSuchElementException;
@@ -137,7 +138,7 @@ private class SlowLoadingElement extends SlowLoadableComponent<SlowLoadingElemen
137138
private WebElement element;
138139

139140
public SlowLoadingElement(Clock clock, int timeOutInSeconds) {
140-
super(clock, timeOutInSeconds);
141+
super(clock, Duration.ofSeconds(timeOutInSeconds));
141142
}
142143

143144
@Override
@@ -178,7 +179,7 @@ private class SlowLoadingElementList extends SlowLoadableComponent<SlowLoadingEl
178179
private List<WebElement> elements;
179180

180181
public SlowLoadingElementList(Clock clock, int timeOutInSeconds) {
181-
super(clock, timeOutInSeconds);
182+
super(clock, Duration.ofSeconds(timeOutInSeconds));
182183
}
183184

184185
@Override

java/src/org/openqa/selenium/support/ui/SlowLoadableComponent.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ public abstract class SlowLoadableComponent<T extends LoadableComponent<T>>
3838
private final Clock clock;
3939
private final Duration timeOut;
4040

41-
/**
42-
* @deprecated Use {@link #SlowLoadableComponent(Clock, Duration)} instead.
43-
*/
44-
@Deprecated
45-
public SlowLoadableComponent(Clock clock, int timeOutInSeconds) {
46-
this(clock, Duration.ofSeconds(timeOutInSeconds));
47-
}
48-
4941
public SlowLoadableComponent(Clock clock, Duration timeOut) {
5042
this.clock = clock;
5143
this.timeOut = timeOut;

java/test/org/openqa/selenium/support/ui/SlowLoadableComponentTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void testShouldCancelLoadingIfAnErrorIsDetected() {
6262
private static class DetonatingSlowLoader extends SlowLoadableComponent<DetonatingSlowLoader> {
6363

6464
public DetonatingSlowLoader() {
65-
super(Clock.systemDefaultZone(), 1);
65+
super(Clock.systemDefaultZone(), Duration.ofSeconds(1));
6666
}
6767

6868
@Override
@@ -82,7 +82,7 @@ private static class SlowLoading extends SlowLoadableComponent<SlowLoading> {
8282
private long loopCount;
8383

8484
public SlowLoading(Clock clock, int timeOutInSeconds, int counts) {
85-
super(clock, timeOutInSeconds);
85+
super(clock, Duration.ofSeconds(timeOutInSeconds));
8686
this.counts = counts;
8787
}
8888

@@ -127,7 +127,7 @@ private static class BasicSlowLoader extends SlowLoadableComponent<BasicSlowLoad
127127
private final TickingClock clock;
128128

129129
public BasicSlowLoader(TickingClock clock, int timeOutInSeconds) {
130-
super(clock, timeOutInSeconds);
130+
super(clock, Duration.ofSeconds(timeOutInSeconds));
131131
this.clock = clock;
132132
}
133133

@@ -148,7 +148,7 @@ protected void isLoaded() throws Error {
148148
private static class HasError extends SlowLoadableComponent<HasError> {
149149

150150
public HasError() {
151-
super(new TickingClock(), 1000);
151+
super(new TickingClock(), Duration.ofSeconds(1000));
152152
}
153153

154154
@Override

0 commit comments

Comments
 (0)