Recognize Checker Framework declaration annotations.

We are migrating Guava to use these annotations rather than jsr305's
@Nullable. We can't use the Checker Framework's _@Nullable_ yet because
we promise compatibility with Java 7, which doesn't support type
annotations. This is related to but distinct from
https://youtrack.jetbrains.com/issue/KT-21408, which is about a
different jsr305 annotation we use, @ParametersAreNonnullByDefault.

I've also updated some docs to mention Kotlin's existing support for the
Checker Framework _@NonNull_.
This commit is contained in:
Chris Povirk
2017-12-04 17:22:54 -05:00
committed by Alexander Udalov
parent 79359b7bc2
commit ac87ad422d
10 changed files with 107 additions and 1 deletions
@@ -0,0 +1,15 @@
package org.checkerframework.checker.nullness.compatqual;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Java 7 compatibility annotation without dependency on Java 8 classes.
*
* @see org.checkerframework.checker.nullness.qual.NonNull
* @checker_framework.manual #nullness-checker Nullness Checker
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface NonNullDecl {}
@@ -0,0 +1,15 @@
package org.checkerframework.checker.nullness.compatqual;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Java 7 compatibility annotation without dependency on Java 8 classes.
*
* @see org.checkerframework.checker.nullness.qual.Nullable
* @checker_framework.manual #nullness-checker Nullness Checker
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface NullableDecl {}