diff --git a/jimfs/pom.xml b/jimfs/pom.xml
index d6a4d9d9..85bd1731 100644
--- a/jimfs/pom.xml
+++ b/jimfs/pom.xml
@@ -60,6 +60,11 @@
jsr305
true
+
+ org.checkerframework
+ checker-compat-qual
+ true
+
diff --git a/jimfs/src/main/java/com/google/common/jimfs/AbstractWatchService.java b/jimfs/src/main/java/com/google/common/jimfs/AbstractWatchService.java
index 46822da0..6b4326d0 100644
--- a/jimfs/src/main/java/com/google/common/jimfs/AbstractWatchService.java
+++ b/jimfs/src/main/java/com/google/common/jimfs/AbstractWatchService.java
@@ -41,7 +41,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.compatqual.NullableDecl;
/**
* Abstract implementation of {@link WatchService}. Provides the means for registering and managing
@@ -90,14 +90,14 @@ ImmutableList queuedKeys() {
return ImmutableList.copyOf(queue);
}
- @Nullable
+ @NullableDecl
@Override
public WatchKey poll() {
checkOpen();
return check(queue.poll());
}
- @Nullable
+ @NullableDecl
@Override
public WatchKey poll(long timeout, TimeUnit unit) throws InterruptedException {
checkOpen();
@@ -111,8 +111,8 @@ public WatchKey take() throws InterruptedException {
}
/** Returns the given key, throwing an exception if it's the poison. */
- @Nullable
- private WatchKey check(@Nullable WatchKey key) {
+ @NullableDecl
+ private WatchKey check(@NullableDecl WatchKey key) {
if (key == poison) {
// ensure other blocking threads get the poison
queue.offer(poison);
@@ -142,9 +142,9 @@ static final class Event implements WatchEvent {
private final Kind kind;
private final int count;
- @Nullable private final T context;
+ @NullableDecl private final T context;
- public Event(Kind kind, int count, @Nullable T context) {
+ public Event(Kind kind, int count, @NullableDecl T context) {
this.kind = checkNotNull(kind);
checkArgument(count >= 0, "count (%s) must be non-negative", count);
this.count = count;
@@ -161,7 +161,7 @@ public int count() {
return count;
}
- @Nullable
+ @NullableDecl
@Override
public T context() {
return context;
@@ -214,7 +214,7 @@ private static WatchEvent
+
+ org.checkerframework
+ checker-compat-qual
+ 2.5.5
+