Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 21c03bd

Browse filesBrowse files
committed
fix internal java.time methods in WatchDog related classes
1 parent 50b0ffd commit 21c03bd
Copy full SHA for 21c03bd

File tree

Expand file treeCollapse file tree

4 files changed

+2
-45
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+2
-45
lines changed

‎gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java

Copy file name to clipboardExpand all lines: gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
import com.google.api.core.ApiClock;
3333
import com.google.api.core.InternalApi;
34-
import com.google.api.core.ObsoleteApi;
3534
import java.util.concurrent.ScheduledExecutorService;
3635
import javax.annotation.Nonnull;
3736
import javax.annotation.Nullable;
@@ -70,12 +69,6 @@ public boolean needsCheckInterval() {
7069
return false;
7170
}
7271

73-
@Override
74-
@ObsoleteApi("Use withCheckInterval(java.time.Duration) instead")
75-
public WatchdogProvider withCheckInterval(org.threeten.bp.Duration checkInterval) {
76-
throw new UnsupportedOperationException("FixedWatchdogProvider doesn't need a checkInterval");
77-
}
78-
7972
@Override
8073
public WatchdogProvider withCheckInterval(java.time.Duration checkInterval) {
8174
throw new UnsupportedOperationException("FixedWatchdogProvider doesn't need a checkInterval");

‎gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java

Copy file name to clipboardExpand all lines: gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java
-15Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@
2929
*/
3030
package com.google.api.gax.rpc;
3131

32-
import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration;
3332

3433
import com.google.api.core.ApiClock;
3534
import com.google.api.core.InternalApi;
36-
import com.google.api.core.ObsoleteApi;
3735
import com.google.common.base.Preconditions;
3836
import java.util.concurrent.ScheduledExecutorService;
3937
import javax.annotation.Nonnull;
@@ -80,19 +78,6 @@ public boolean needsCheckInterval() {
8078
return checkInterval == null;
8179
}
8280

83-
/**
84-
* Overload of {@link #withCheckInterval(java.time.Duration)} using {@link
85-
* org.threeten.bp.Duration}
86-
*
87-
* @param checkInterval
88-
* @return
89-
*/
90-
@Override
91-
@ObsoleteApi("Use withCheckInterval(java.time.Duration) instead")
92-
public WatchdogProvider withCheckInterval(@Nonnull org.threeten.bp.Duration checkInterval) {
93-
return withCheckInterval(toJavaTimeDuration(Preconditions.checkNotNull(checkInterval)));
94-
}
95-
9681
@Override
9782
public WatchdogProvider withCheckInterval(@Nonnull java.time.Duration checkInterval) {
9883
return new InstantiatingWatchdogProvider(

‎gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogProvider.java

Copy file name to clipboardExpand all lines: gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogProvider.java
+2-8Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,18 @@
3030
package com.google.api.gax.rpc;
3131

3232
import com.google.api.core.ApiClock;
33-
import com.google.api.core.ObsoleteApi;
33+
import com.google.api.core.InternalApi;
3434
import java.util.concurrent.ScheduledExecutorService;
3535
import javax.annotation.Nonnull;
3636

37+
@InternalApi
3738
public interface WatchdogProvider {
3839
boolean needsClock();
3940

4041
WatchdogProvider withClock(@Nonnull ApiClock clock);
4142

4243
boolean needsCheckInterval();
4344

44-
/**
45-
* Overload of {@link #withCheckInterval(java.time.Duration)} using {@link
46-
* org.threeten.bp.Duration}
47-
*/
48-
@ObsoleteApi("Use withCheckInterval(java.time.Duration) instead")
49-
WatchdogProvider withCheckInterval(org.threeten.bp.Duration checkInterval);
50-
5145
WatchdogProvider withCheckInterval(java.time.Duration checkInterval);
5246

5347
boolean needsExecutor();

‎gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedWatchdogProviderTest.java

Copy file name to clipboardExpand all lines: gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedWatchdogProviderTest.java
-15Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
*/
3030
package com.google.api.gax.rpc;
3131

32-
import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod;
3332
import static com.google.common.truth.Truth.assertThat;
34-
import static org.junit.Assert.assertThrows;
3533

3634
import com.google.api.core.ApiClock;
3735
import java.util.concurrent.ScheduledExecutorService;
@@ -98,17 +96,4 @@ public void testNoModifications() {
9896
}
9997
assertThat(actualError).isInstanceOf(UnsupportedOperationException.class);
10098
}
101-
102-
@Test
103-
public void testWithCheckInterval_backportMethodsBehaveCorrectly() {
104-
final FixedWatchdogProvider provider =
105-
(FixedWatchdogProvider) FixedWatchdogProvider.create(null);
106-
long millis = 123l;
107-
assertThrows(
108-
UnsupportedOperationException.class,
109-
() -> provider.withCheckInterval(java.time.Duration.ofMillis(millis)));
110-
assertThrows(
111-
UnsupportedOperationException.class,
112-
() -> provider.withCheckInterval(org.threeten.bp.Duration.ofMillis(millis)));
113-
}
11499
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.