Skip to content

Commit

Permalink
Migrate from Checker Framework annotations to JSpecify.
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 704266700
  • Loading branch information
cpovirk authored and Jimfs Team committed Dec 9, 2024
1 parent 5245040 commit 3622daf
Show file tree
Hide file tree
Showing 39 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions jimfs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<optional>true</optional>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Abstract implementation of {@link WatchService}. Provides the means for registering and managing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.nio.file.attribute.UserPrincipal;
import java.util.List;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Attribute provider that provides the {@link AclFileAttributeView} ("acl").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.nio.file.attribute.FileAttributeView;
import java.util.Arrays;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Abstract provider for handling a specific file attribute view.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Service providing all attribute related operations for a file store. One piece of the file store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileAttributeView;
import java.nio.file.attribute.FileTime;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Attribute provider that provides attributes common to all file systems, the {@link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Immutable configuration for an in-memory file system. A {@code Configuration} is passed to a
Expand Down
2 changes: 1 addition & 1 deletion jimfs/src/main/java/com/google/common/jimfs/Directory.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.nio.file.attribute.FileTime;
import java.util.Iterator;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A table of {@linkplain DirectoryEntry directory entries}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.nio.file.NotLinkException;
import java.nio.file.Path;
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Entry in a directory, containing references to the directory itself, the file the entry links to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.nio.file.attribute.FileAttributeView;
import java.nio.file.attribute.FileTime;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Attribute provider that provides the {@link DosFileAttributeView} ("dos") and allows the reading
Expand Down
2 changes: 1 addition & 1 deletion jimfs/src/main/java/com/google/common/jimfs/File.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.io.IOException;
import java.nio.file.attribute.FileTime;
import java.util.concurrent.locks.ReadWriteLock;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A file object, containing both the file's metadata and content.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* View of a file system with a specific working directory. As all file system operations need to
Expand Down
2 changes: 1 addition & 1 deletion jimfs/src/main/java/com/google/common/jimfs/FileTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* The tree of directories and files for the file system. Contains the file system root directories
Expand Down
2 changes: 1 addition & 1 deletion jimfs/src/main/java/com/google/common/jimfs/Handler.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* {@link URLStreamHandler} implementation for jimfs. Named {@code Handler} so that the class can be
Expand Down
2 changes: 1 addition & 1 deletion jimfs/src/main/java/com/google/common/jimfs/Jimfs.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Static factory methods for creating new Jimfs file systems. File systems may either be created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* {@link AsynchronousFileChannel} implementation that delegates to a {@link JimfsFileChannel}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* {@link FileStore} implementation which provides methods for file creation, lookup and attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.nio.file.attribute.UserPrincipalLookupService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* {@link FileSystem} implementation for Jimfs. Most behavior for the file system is implemented by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* {@link FileSystemProvider} implementation for Jimfs. This provider implements the actual file
Expand Down
2 changes: 1 addition & 1 deletion jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Jimfs implementation of {@link Path}. Creation of new {@code Path} objects is delegated to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import java.nio.file.attribute.FileAttributeView;
import java.util.Iterator;
import java.util.Set;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Secure directory stream implementation that uses a {@link FileSystemView} with the stream's
Expand Down
2 changes: 1 addition & 1 deletion jimfs/src/main/java/com/google/common/jimfs/Name.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import com.google.common.annotations.VisibleForTesting;
import java.util.Comparator;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Immutable representation of a file name. Used both for the name components of paths and as the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.nio.file.attribute.FileOwnerAttributeView;
import java.nio.file.attribute.UserPrincipal;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Attribute provider that provides the {@link FileOwnerAttributeView} ("owner").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Service for creating {@link JimfsPath} instances and handling other path-related operations.
Expand Down
2 changes: 1 addition & 1 deletion jimfs/src/main/java/com/google/common/jimfs/PathType.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.net.URISyntaxException;
import java.nio.file.InvalidPathException;
import java.util.Arrays;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* An object defining a specific type of path. Knows how to parse strings to a path and how to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* {@code URLConnection} implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import java.nio.file.attribute.UserPrincipal;
import java.util.Map;
import java.util.Set;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Attribute provider that provides the {@link PosixFileAttributeView} ("posix") and allows reading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.google.common.jimfs;

import com.google.common.collect.ImmutableMap;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Static registry of {@link AttributeProvider} implementations for the standard set of file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Attribute provider that provides the "unix" attribute view.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static com.google.common.base.Preconditions.checkArgument;

import java.nio.file.InvalidPathException;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Unix-style path type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.nio.file.attribute.FileAttributeView;
import java.nio.file.attribute.UserDefinedFileAttributeView;
import java.util.List;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Attribute provider that provides the {@link UserDefinedFileAttributeView} ("user"). Unlike most
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Windows-style path type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.nio.file.WatchService;
import java.util.Iterator;
import java.util.regex.PatternSyntaxException;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Abstract base class for tests of {@link PathMatcher} implementations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.google.common.collect.Iterables;
import java.util.HashSet;
import java.util.Set;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Subject for doing assertions on file system paths.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.jimfs.PathType.ParseResult;
import java.net.URI;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.nio.file.attribute.FileTime;
import java.util.HashMap;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/** @author Colin Decker */
public final class TestAttributeProvider extends AttributeProvider {
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>3.48.2</version>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>1.0.0</version>
</dependency>

<!-- Test dependencies -->
Expand Down

0 comments on commit 3622daf

Please sign in to comment.