aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Shapiro <shapiro.rd@gmail.com>2019-04-18 17:00:26 -0400
committerGitHub <noreply@github.com>2019-04-18 17:00:26 -0400
commit4f1696afa48c50944ee8bcec7d1e56ea4e1ba935 (patch)
tree4162a18cc2e10633ac0cb904f7d0ff4b02ab8f10
parent4adbdea4091229b9ef727fa5d6eeef00b2429e01 (diff)
downloadjimfs-4f1696afa48c50944ee8bcec7d1e56ea4e1ba935.tar.gz
Enable GoodTime-API for JimFS. (#79)
RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=244183449
-rw-r--r--jimfs/src/main/java/com/google/common/jimfs/File.java17
-rw-r--r--jimfs/src/main/java/com/google/common/jimfs/WatchServiceConfiguration.java5
2 files changed, 9 insertions, 13 deletions
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);
}