Skip to content

Commit c9e6926

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Minor updates after recent changes for Java 8 APIs.
RELNOTES=n/a PiperOrigin-RevId: 711817437
1 parent 993aa76 commit c9e6926

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (C) 2008 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.common.base;
18+
19+
import com.google.common.annotations.GwtIncompatible;
20+
import com.google.common.annotations.J2ktIncompatible;
21+
import com.google.common.testing.FakeTicker;
22+
import java.time.Duration;
23+
import junit.framework.TestCase;
24+
import org.jspecify.annotations.NullUnmarked;
25+
26+
/** Unit test for the {@code java.time} support in {@link Stopwatch}. */
27+
@J2ktIncompatible
28+
@GwtIncompatible
29+
@NullUnmarked
30+
public class StopwatchJavaTimeTest extends TestCase {
31+
private final FakeTicker ticker = new FakeTicker();
32+
private final Stopwatch stopwatch = new Stopwatch(ticker);
33+
34+
public void testElapsed_duration() {
35+
stopwatch.start();
36+
ticker.advance(999999);
37+
assertEquals(Duration.ofNanos(999999), stopwatch.elapsed());
38+
ticker.advance(1);
39+
assertEquals(Duration.ofMillis(1), stopwatch.elapsed());
40+
}
41+
}

android/guava/src/com/google/common/collect/CollectCollectors.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
@GwtCompatible
4343
@SuppressWarnings("Java7ApiChecker")
4444
@IgnoreJRERequirement // used only from APIs with Java 8 types in them
45-
// (not used publicly by guava-android as of this writing, but we include it in the jar as a test)
4645
final class CollectCollectors {
4746

4847
private static final Collector<Object, ?, ImmutableList<Object>> TO_IMMUTABLE_LIST =

android/guava/src/com/google/common/collect/TableCollectors.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
@GwtCompatible
3333
@SuppressWarnings("Java7ApiChecker")
3434
@IgnoreJRERequirement // used only from APIs with Java 8 types in them
35-
// (not used publicly by guava-android as of this writing, but we include it in the jar as a test)
3635
final class TableCollectors {
3736

3837
static <T extends @Nullable Object, R, C, V>

0 commit comments

Comments
 (0)