From 4f1696afa48c50944ee8bcec7d1e56ea4e1ba935 Mon Sep 17 00:00:00 2001 From: Ron Shapiro Date: Thu, 18 Apr 2019 17:00:26 -0400 Subject: Enable GoodTime-API for JimFS. (#79) RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=244183449 --- jimfs/src/main/java/com/google/common/jimfs/File.java | 17 ++++++----------- .../google/common/jimfs/WatchServiceConfiguration.java | 5 +++-- 2 files changed, 9 insertions(+), 13 deletions(-) (limited to 'jimfs/src/main/java/com') diff --git a/jimfs/src/main/java/com/google/common/jimfs/File.java b/jimfs/src/main/java/com/google/common/jimfs/File.java index 99a4f59..d79b6cb 100644 --- a/jimfs/src/main/java/com/google/common/jimfs/File.java +++ b/jimfs/src/main/java/com/google/common/jimfs/File.java @@ -23,10 +23,8 @@ import com.google.common.base.MoreObjects; import com.google.common.collect.HashBasedTable; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Table; - import java.io.IOException; import java.util.concurrent.locks.ReadWriteLock; - import javax.annotation.Nullable; /** @@ -176,23 +174,20 @@ public abstract class File { links--; } - /** - * Gets the creation time of the file. - */ + /** Gets the creation time of the file. */ + @SuppressWarnings("GoodTime") // should return a java.time.Instant public synchronized final long getCreationTime() { return creationTime; } - /** - * Gets the last access time of the file. - */ + /** Gets the last access time of the file. */ + @SuppressWarnings("GoodTime") // should return a java.time.Instant public synchronized final long getLastAccessTime() { return lastAccessTime; } - /** - * Gets the last modified time of the file. - */ + /** Gets the last modified time of the file. */ + @SuppressWarnings("GoodTime") // should return a java.time.Instant public synchronized final long getLastModifiedTime() { return lastModifiedTime; } diff --git a/jimfs/src/main/java/com/google/common/jimfs/WatchServiceConfiguration.java b/jimfs/src/main/java/com/google/common/jimfs/WatchServiceConfiguration.java index 4ef1a06..a93e8e3 100644 --- a/jimfs/src/main/java/com/google/common/jimfs/WatchServiceConfiguration.java +++ b/jimfs/src/main/java/com/google/common/jimfs/WatchServiceConfiguration.java @@ -38,9 +38,10 @@ public abstract class WatchServiceConfiguration { /** * Returns a configuration for a {@link WatchService} that polls watched directories for changes - * every {@code interval} of the given {@code timeUnit} (e.g. every 5 - * {@link TimeUnit#SECONDS seconds}). + * every {@code interval} of the given {@code timeUnit} (e.g. every 5 {@link TimeUnit#SECONDS + * seconds}). */ + @SuppressWarnings("GoodTime") // should accept a java.time.Duration public static WatchServiceConfiguration polling(long interval, TimeUnit timeUnit) { return new PollingConfig(interval, timeUnit); } -- cgit v1.2.3