diff options
author | Colin Cross <ccross@android.com> | 2019-11-07 11:36:08 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-11-07 11:36:08 -0800 |
commit | 1311f27c72b53e8b1145597cbe7e0fa0dca14045 (patch) | |
tree | fcfb84bb31826a30c86ba7db7c9154a134bd6b5d | |
parent | 8960c383b44e391e6097d3d7c31a42720d2f8c8b (diff) | |
parent | 6c3547da3027c073cb52ede33805e7cdbfe998e1 (diff) | |
download | turbine-1311f27c72b53e8b1145597cbe7e0fa0dca14045.tar.gz |
Restore checkerframework annotations am: 73a0dbfcc0
am: 6c3547da30
Change-Id: If988f72eee35bf1b7638e0acb57ac1a0b57105e8
22 files changed, 26 insertions, 30 deletions
@@ -26,7 +26,6 @@ java_library_host { static_libs: [ "error_prone_annotations", "guava-21.0", - "jsr305-3.0.1", ], plugins: ["dagger2-auto-value"], diff --git a/java/com/google/turbine/binder/CtSymClassBinder.java b/java/com/google/turbine/binder/CtSymClassBinder.java index d9d74ab..84fa966 100644 --- a/java/com/google/turbine/binder/CtSymClassBinder.java +++ b/java/com/google/turbine/binder/CtSymClassBinder.java @@ -37,7 +37,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** Constructs a platform {@link ClassPath} from the current JDK's ct.sym file. */ public class CtSymClassBinder { diff --git a/java/com/google/turbine/binder/JimageClassBinder.java b/java/com/google/turbine/binder/JimageClassBinder.java index b32b8ea..e3d0865 100644 --- a/java/com/google/turbine/binder/JimageClassBinder.java +++ b/java/com/google/turbine/binder/JimageClassBinder.java @@ -51,7 +51,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** Constructs a platform {@link ClassPath} from the current JDK's jimage file using jrtfs. */ public class JimageClassBinder { diff --git a/java/com/google/turbine/binder/bound/BoundClass.java b/java/com/google/turbine/binder/bound/BoundClass.java index ad26af7..61dee0f 100644 --- a/java/com/google/turbine/binder/bound/BoundClass.java +++ b/java/com/google/turbine/binder/bound/BoundClass.java @@ -19,7 +19,7 @@ package com.google.turbine.binder.bound; import com.google.common.collect.ImmutableMap; import com.google.turbine.binder.sym.ClassSymbol; import com.google.turbine.model.TurbineTyKind; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** * The initial bound tree representation. diff --git a/java/com/google/turbine/binder/bound/ModuleInfo.java b/java/com/google/turbine/binder/bound/ModuleInfo.java index 9afd474..f21213b 100644 --- a/java/com/google/turbine/binder/bound/ModuleInfo.java +++ b/java/com/google/turbine/binder/bound/ModuleInfo.java @@ -19,7 +19,7 @@ package com.google.turbine.binder.bound; import com.google.common.collect.ImmutableList; import com.google.turbine.binder.sym.ClassSymbol; import com.google.turbine.type.AnnoInfo; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** A bound module declaration (see JLS §7.7). */ public class ModuleInfo { diff --git a/java/com/google/turbine/binder/bound/SourceModuleInfo.java b/java/com/google/turbine/binder/bound/SourceModuleInfo.java index b763ede..1163e9f 100644 --- a/java/com/google/turbine/binder/bound/SourceModuleInfo.java +++ b/java/com/google/turbine/binder/bound/SourceModuleInfo.java @@ -16,7 +16,6 @@ package com.google.turbine.binder.bound; -import javax.annotation.Nullable; import com.google.common.collect.ImmutableList; import com.google.turbine.binder.bound.ModuleInfo.ExportInfo; import com.google.turbine.binder.bound.ModuleInfo.OpenInfo; @@ -25,6 +24,7 @@ import com.google.turbine.binder.bound.ModuleInfo.RequireInfo; import com.google.turbine.binder.bound.ModuleInfo.UseInfo; import com.google.turbine.diag.SourceFile; import com.google.turbine.type.AnnoInfo; +import org.checkerframework.checker.nullness.qual.Nullable; /** A {@link ModuleInfo} that corresponds to a source file being compiled. */ public class SourceModuleInfo extends ModuleInfo { diff --git a/java/com/google/turbine/binder/bound/SourceTypeBoundClass.java b/java/com/google/turbine/binder/bound/SourceTypeBoundClass.java index 7314f72..69a2593 100644 --- a/java/com/google/turbine/binder/bound/SourceTypeBoundClass.java +++ b/java/com/google/turbine/binder/bound/SourceTypeBoundClass.java @@ -29,7 +29,7 @@ import com.google.turbine.type.AnnoInfo; import com.google.turbine.type.Type; import com.google.turbine.type.Type.ClassTy; import com.google.turbine.type.Type.TyKind; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** A HeaderBoundClass for classes compiled from source. */ public class SourceTypeBoundClass implements TypeBoundClass { diff --git a/java/com/google/turbine/binder/bytecode/BytecodeBoundClass.java b/java/com/google/turbine/binder/bytecode/BytecodeBoundClass.java index 6e882e6..6ff8cb4 100644 --- a/java/com/google/turbine/binder/bytecode/BytecodeBoundClass.java +++ b/java/com/google/turbine/binder/bytecode/BytecodeBoundClass.java @@ -58,7 +58,7 @@ import com.google.turbine.type.Type.IntersectionTy; import java.lang.annotation.RetentionPolicy; import java.util.Map; import java.util.function.Function; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** * A bound class backed by a class file. diff --git a/java/com/google/turbine/binder/env/CompoundEnv.java b/java/com/google/turbine/binder/env/CompoundEnv.java index 43ce768..9b216e3 100644 --- a/java/com/google/turbine/binder/env/CompoundEnv.java +++ b/java/com/google/turbine/binder/env/CompoundEnv.java @@ -19,7 +19,7 @@ package com.google.turbine.binder.env; import static java.util.Objects.requireNonNull; import com.google.turbine.binder.sym.Symbol; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** An {@link Env} that chains two existing envs together. */ public class CompoundEnv<S extends Symbol, V> implements Env<S, V> { diff --git a/java/com/google/turbine/binder/lookup/CompoundScope.java b/java/com/google/turbine/binder/lookup/CompoundScope.java index a14eb05..11309bf 100644 --- a/java/com/google/turbine/binder/lookup/CompoundScope.java +++ b/java/com/google/turbine/binder/lookup/CompoundScope.java @@ -18,7 +18,7 @@ package com.google.turbine.binder.lookup; import static com.google.common.base.Preconditions.checkNotNull; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** A {@link Scope} that chains other scopes together. */ public class CompoundScope implements Scope { diff --git a/java/com/google/turbine/binder/lookup/CompoundTopLevelIndex.java b/java/com/google/turbine/binder/lookup/CompoundTopLevelIndex.java index 526e493..de50a2e 100644 --- a/java/com/google/turbine/binder/lookup/CompoundTopLevelIndex.java +++ b/java/com/google/turbine/binder/lookup/CompoundTopLevelIndex.java @@ -19,7 +19,7 @@ package com.google.turbine.binder.lookup; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.collect.ImmutableList; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** A {@link TopLevelIndex} that aggregates multiple indices into one. */ // Note: this implementation doesn't detect if the indices contain incompatible information, diff --git a/java/com/google/turbine/binder/lookup/Scope.java b/java/com/google/turbine/binder/lookup/Scope.java index 682a62a..12466f4 100644 --- a/java/com/google/turbine/binder/lookup/Scope.java +++ b/java/com/google/turbine/binder/lookup/Scope.java @@ -16,7 +16,7 @@ package com.google.turbine.binder.lookup; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** A scope that defines types, and supports qualified name resolution. */ public interface Scope { diff --git a/java/com/google/turbine/binder/lookup/SimpleTopLevelIndex.java b/java/com/google/turbine/binder/lookup/SimpleTopLevelIndex.java index 99aa464..2454319 100644 --- a/java/com/google/turbine/binder/lookup/SimpleTopLevelIndex.java +++ b/java/com/google/turbine/binder/lookup/SimpleTopLevelIndex.java @@ -21,7 +21,7 @@ import com.google.turbine.binder.sym.ClassSymbol; import java.util.HashMap; import java.util.Map; import java.util.Objects; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** * An index of canonical type names where all members are known statically. diff --git a/java/com/google/turbine/bytecode/ClassFile.java b/java/com/google/turbine/bytecode/ClassFile.java index 422f8c6..54b6983 100644 --- a/java/com/google/turbine/bytecode/ClassFile.java +++ b/java/com/google/turbine/bytecode/ClassFile.java @@ -26,7 +26,7 @@ import java.util.ArrayDeque; import java.util.Deque; import java.util.List; import java.util.Map; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** A JVMS §4.1 ClassFile. */ public class ClassFile { @@ -131,7 +131,7 @@ public class ClassFile { private final String name; private final String descriptor; @Nullable private final String signature; - @Nullable private final Const.Value value; + private final Const.@Nullable Value value; private final List<AnnotationInfo> annotations; private final ImmutableList<TypeAnnotationInfo> typeAnnotations; @@ -174,8 +174,7 @@ public class ClassFile { } /** The compile-time constant value. */ - @Nullable - public Const.Value value() { + public Const.@Nullable Value value() { return value; } @@ -234,7 +233,7 @@ public class ClassFile { private final String descriptor; @Nullable private final String signature; private final List<String> exceptions; - @Nullable private final AnnotationInfo.ElementValue defaultValue; + private final AnnotationInfo.@Nullable ElementValue defaultValue; private final List<AnnotationInfo> annotations; private final ImmutableList<ImmutableList<AnnotationInfo>> parameterAnnotations; private final ImmutableList<TypeAnnotationInfo> typeAnnotations; @@ -290,8 +289,7 @@ public class ClassFile { } /** The value of the AnnotationDefault attribute. */ - @Nullable - public AnnotationInfo.ElementValue defaultValue() { + public AnnotationInfo.@Nullable ElementValue defaultValue() { return defaultValue; } diff --git a/java/com/google/turbine/bytecode/ClassReader.java b/java/com/google/turbine/bytecode/ClassReader.java index dc5e050..a894997 100644 --- a/java/com/google/turbine/bytecode/ClassReader.java +++ b/java/com/google/turbine/bytecode/ClassReader.java @@ -35,7 +35,7 @@ import com.google.turbine.bytecode.ClassFile.ModuleInfo.UseInfo; import com.google.turbine.model.Const; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** A JVMS §4 class file reader. */ public class ClassReader { diff --git a/java/com/google/turbine/bytecode/sig/Sig.java b/java/com/google/turbine/bytecode/sig/Sig.java index 8a326ec..e85740f 100644 --- a/java/com/google/turbine/bytecode/sig/Sig.java +++ b/java/com/google/turbine/bytecode/sig/Sig.java @@ -18,7 +18,7 @@ package com.google.turbine.bytecode.sig; import com.google.common.collect.ImmutableList; import com.google.turbine.model.TurbineConstantTypeKind; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** JVMS 4.7.9.1 signatures. */ public class Sig { diff --git a/java/com/google/turbine/lower/Lower.java b/java/com/google/turbine/lower/Lower.java index 97fbd6e..16447ab 100644 --- a/java/com/google/turbine/lower/Lower.java +++ b/java/com/google/turbine/lower/Lower.java @@ -84,7 +84,7 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** Lowering from bound classes to bytecode. */ public class Lower { diff --git a/java/com/google/turbine/options/TurbineOptions.java b/java/com/google/turbine/options/TurbineOptions.java index 3bc9755..0ce0c13 100644 --- a/java/com/google/turbine/options/TurbineOptions.java +++ b/java/com/google/turbine/options/TurbineOptions.java @@ -21,7 +21,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import java.util.Optional; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** Header compilation options. */ public class TurbineOptions { diff --git a/java/com/google/turbine/options/TurbineOptionsParser.java b/java/com/google/turbine/options/TurbineOptionsParser.java index 5b1f326..55697ca 100644 --- a/java/com/google/turbine/options/TurbineOptionsParser.java +++ b/java/com/google/turbine/options/TurbineOptionsParser.java @@ -29,7 +29,7 @@ import java.nio.file.Paths; import java.util.ArrayDeque; import java.util.Deque; import java.util.Iterator; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** A command line options parser for {@link TurbineOptions}. */ public class TurbineOptionsParser { diff --git a/java/com/google/turbine/parse/ConstExpressionParser.java b/java/com/google/turbine/parse/ConstExpressionParser.java index c6cb284..b3666a4 100644 --- a/java/com/google/turbine/parse/ConstExpressionParser.java +++ b/java/com/google/turbine/parse/ConstExpressionParser.java @@ -31,7 +31,7 @@ import com.google.turbine.tree.Tree.Expression; import com.google.turbine.tree.Tree.Ident; import com.google.turbine.tree.TurbineOperatorKind; import java.util.Optional; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** A parser for compile-time constant expressions. */ public class ConstExpressionParser { @@ -419,8 +419,7 @@ public class ConstExpressionParser { return new Tree.Unary(position, expr, op); } - @Nullable - private Tree.Expression qualIdent() { + private Tree.@Nullable Expression qualIdent() { int pos = position; ImmutableList.Builder<Ident> bits = ImmutableList.builder(); bits.add(ident()); diff --git a/java/com/google/turbine/parse/Parser.java b/java/com/google/turbine/parse/Parser.java index dd45b0d..ff3cc3e 100644 --- a/java/com/google/turbine/parse/Parser.java +++ b/java/com/google/turbine/parse/Parser.java @@ -62,7 +62,7 @@ import java.util.Deque; import java.util.EnumSet; import java.util.List; import java.util.Optional; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** * A parser for the subset of Java required for header compilation. diff --git a/java/com/google/turbine/types/Canonicalize.java b/java/com/google/turbine/types/Canonicalize.java index a8861da..ab73618 100644 --- a/java/com/google/turbine/types/Canonicalize.java +++ b/java/com/google/turbine/types/Canonicalize.java @@ -44,7 +44,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; /** * Canonicalizes qualified type names so qualifiers are always the declaring class of the qualified |