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: 704250442
  • Loading branch information
cpovirk authored and Compile-Testing Team committed Dec 9, 2024
1 parent 985a279 commit 0a84237
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
<version>1.2.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>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import javax.tools.JavaFileManager.Location;
import javax.tools.JavaFileObject;
import javax.tools.StandardLocation;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/** A {@link Truth} subject for a {@link Compilation}. */
public final class CompilationSubject extends Subject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.google.common.truth.FailureMetadata;
import com.google.common.truth.Subject;
import com.google.common.truth.Truth;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/** A {@link Truth} subject factory for a {@link Compilation}. */
final class CompilationSubjectFactory implements Subject.Factory<CompilationSubject, Compilation> {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/google/testing/compile/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/** An object that can {@link #compile} Java source files. */
@AutoValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import javax.tools.SimpleJavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A file manager implementation that stores all output in memory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import java.nio.charset.Charset;
import java.util.function.BiFunction;
import javax.tools.JavaFileObject;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/** Assertions about {@link JavaFileObject}s. */
public final class JavaFileObjectSubject extends Subject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.google.common.truth.FailureMetadata;
import com.google.common.truth.Subject;
import javax.tools.JavaFileObject;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/** A factory for {@link JavaFileObjectSubject}s. */
final class JavaFileObjectSubjectFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.google.common.truth.FailureMetadata;
import com.google.common.truth.Subject;
import javax.tools.JavaFileObject;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A <a href="https://github.com/truth0/truth">Truth</a> {@link Subject.Factory} similar to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import javax.tools.Diagnostic.Kind;
import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A <a href="https://github.com/truth0/truth">Truth</a> {@link Subject} that evaluates the result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.google.common.truth.FailureMetadata;
import com.google.common.truth.Subject;
import javax.tools.JavaFileObject;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A <a href="https://github.com/truth0/truth">Truth</a> {@link Subject.Factory} for creating
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/google/testing/compile/MoreTrees.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import com.sun.source.util.TreePathScanner;
import java.util.Arrays;
import java.util.Optional;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A class containing methods which are useful for gaining access to {@code Tree} instances from
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/google/testing/compile/TreeDiffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import javax.lang.model.element.Name;
import javax.lang.model.type.TypeMirror;
import javax.tools.JavaFileObject;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A class for determining how two compilation {@code Tree}s differ from each other.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.sun.source.tree.Tree;
import com.sun.source.util.TreePath;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A data structure describing the set of syntactic differences between two {@link Tree}s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.sun.source.tree.Tree;
import com.sun.source.util.TreeScanner;
import java.util.Set;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Provides information about the set of types that are declared by a {@code CompilationUnitTree}.
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/google/testing/compile/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
* </pre>
*/
@CheckReturnValue
@NullMarked
package com.google.testing.compile;

import com.google.errorprone.annotations.CheckReturnValue;
import org.jspecify.annotations.NullMarked;

0 comments on commit 0a84237

Please sign in to comment.