Store third-party annotations in a separate directory
This commit is contained in:
-34
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package android.support.annotation;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.CLASS;
|
||||
|
||||
/**
|
||||
* Denotes that a parameter, field or method return value can never be null.
|
||||
* <p>
|
||||
* This is a marker annotation and it has no specific attributes.
|
||||
*/
|
||||
@Retention(CLASS)
|
||||
@Target({METHOD, PARAMETER, FIELD})
|
||||
public @interface NonNull {
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package android.support.annotation;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.CLASS;
|
||||
|
||||
/**
|
||||
* Denotes that a parameter, field or method return value can be null.
|
||||
* <p>
|
||||
* When decorating a method call parameter, this denotes that the parameter can
|
||||
* legitimately be null and the method will gracefully deal with it. Typically
|
||||
* used on optional parameters.
|
||||
* <p>
|
||||
* When decorating a method, this denotes the method might legitimately return
|
||||
* null.
|
||||
* <p>
|
||||
* This is a marker annotation and it has no specific attributes.
|
||||
*/
|
||||
@Retention(CLASS)
|
||||
@Target({METHOD, PARAMETER, FIELD})
|
||||
public @interface Nullable {
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.annotations;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Denotes that a parameter, field or method return value can never be null.
|
||||
* <p/>
|
||||
* This is a marker annotation and it has no specific attributes.
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@Target({METHOD,PARAMETER,LOCAL_VARIABLE,FIELD})
|
||||
public @interface NonNull {
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.annotations;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Denotes that a parameter, field or method return value can be null.
|
||||
* <b>Note</b>: this is the default assumption for most Java APIs and the
|
||||
* default assumption made by most static code checking tools, so usually you
|
||||
* don't need to use this annotation; its primary use is to override a default
|
||||
* wider annotation like {@link NonNullByDefault}.
|
||||
* <p/>
|
||||
* When decorating a method call parameter, this denotes the parameter can
|
||||
* legitimately be null and the method will gracefully deal with it. Typically
|
||||
* used on optional parameters.
|
||||
* <p/>
|
||||
* When decorating a method, this denotes the method might legitimately return
|
||||
* null.
|
||||
* <p/>
|
||||
* This is a marker annotation and it has no specific attributes.
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@Target({METHOD, PARAMETER, LOCAL_VARIABLE, FIELD})
|
||||
public @interface Nullable {
|
||||
}
|
||||
Vendored
-47
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Bytecode Analysis Framework
|
||||
* Copyright (C) 2005 University of Maryland
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package edu.umd.cs.findbugs.annotations;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
/**
|
||||
* The annotated element might be null, and uses of the element should check for
|
||||
* null.
|
||||
*
|
||||
* When this annotation is applied to a method it applies to the method return
|
||||
* value.
|
||||
*
|
||||
* @deprecated - use {@link javax.annotation.CheckForNull} instead.
|
||||
**/
|
||||
@Documented
|
||||
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE })
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@javax.annotation.Nonnull(when = When.MAYBE)
|
||||
@TypeQualifierNickname
|
||||
@Deprecated
|
||||
public @interface CheckForNull {
|
||||
|
||||
}
|
||||
Vendored
-46
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Bytecode Analysis Framework
|
||||
* Copyright (C) 2005 University of Maryland
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package edu.umd.cs.findbugs.annotations;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
/**
|
||||
* The annotated element must not be null.
|
||||
*
|
||||
* Annotated Fields must only not be null after construction has completed.
|
||||
* Annotated methods must have non-null return values.
|
||||
*
|
||||
* @deprecated - use {@link javax.annotation.Nonnull} instead.
|
||||
**/
|
||||
@Documented
|
||||
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE })
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@javax.annotation.Nonnull(when = When.ALWAYS)
|
||||
@TypeQualifierNickname
|
||||
@Deprecated
|
||||
public @interface NonNull {
|
||||
|
||||
}
|
||||
Vendored
-50
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Bytecode Analysis Framework
|
||||
* Copyright (C) 2005 University of Maryland
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package edu.umd.cs.findbugs.annotations;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
/**
|
||||
* The annotated element could be null under some circumstances.
|
||||
*
|
||||
* In general, this means developers will have to read the documentation to
|
||||
* determine when a null value is acceptable and whether it is necessary to
|
||||
* check for a null value.
|
||||
*
|
||||
* When this annotation is applied to a method it applies to the method return
|
||||
* value.
|
||||
*
|
||||
* @deprecated - use {@link javax.annotation.Nullable} instead.
|
||||
**/
|
||||
@Documented
|
||||
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE })
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@javax.annotation.Nonnull(when = When.UNKNOWN)
|
||||
@TypeQualifierNickname
|
||||
@Deprecated
|
||||
public @interface Nullable {
|
||||
|
||||
}
|
||||
Vendored
-49
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Bytecode Analysis Framework
|
||||
* Copyright (C) 2005 University of Maryland
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package edu.umd.cs.findbugs.annotations;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
/**
|
||||
* The annotated element should might be null, and uses of the element should
|
||||
* check for null.
|
||||
*
|
||||
* When this annotation is applied to a method it applies to the method return
|
||||
* value.
|
||||
*
|
||||
* @deprecated - use CheckForNull instead; the name of which more clearly
|
||||
* indicates that not only could the value be null, but that good
|
||||
* coding practice requires that the value be checked for null.
|
||||
**/
|
||||
@Documented
|
||||
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE })
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@javax.annotation.Nonnull(when = When.MAYBE)
|
||||
@TypeQualifierNickname
|
||||
@Deprecated
|
||||
public @interface PossiblyNull {
|
||||
|
||||
}
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Bytecode Analysis Framework
|
||||
* Copyright (C) 2005-2006 University of Maryland
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package edu.umd.cs.findbugs.annotations;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
/**
|
||||
* Used to indicate that the nullness of element is unknown, or may vary in
|
||||
* unknown ways in subclasses.
|
||||
**/
|
||||
@Documented
|
||||
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE })
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@javax.annotation.Nonnull(when = When.UNKNOWN)
|
||||
@TypeQualifierNickname
|
||||
@Deprecated
|
||||
public @interface UnknownNullness {
|
||||
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2016-present, RxJava Contributors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is
|
||||
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package io.reactivex.annotations;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.CLASS;
|
||||
|
||||
/**
|
||||
* Indicates that a field/parameter/variable/return type is never null.
|
||||
*/
|
||||
@Documented
|
||||
@Target(value = {FIELD, METHOD, PARAMETER, LOCAL_VARIABLE})
|
||||
@Retention(value = CLASS)
|
||||
public @interface NonNull { }
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2016-present, RxJava Contributors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is
|
||||
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package io.reactivex.annotations;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.CLASS;
|
||||
|
||||
/**
|
||||
* Indicates that a field/parameter/variable/return type may be null.
|
||||
*/
|
||||
@Documented
|
||||
@Target(value = {FIELD, METHOD, PARAMETER, LOCAL_VARIABLE})
|
||||
@Retention(value = CLASS)
|
||||
public @interface Nullable { }
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package javax.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifierNickname
|
||||
@Nonnull(when = When.MAYBE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface CheckForNull {
|
||||
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package javax.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifier;
|
||||
import javax.annotation.meta.TypeQualifierValidator;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifier
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Nonnull {
|
||||
When when() default When.ALWAYS;
|
||||
|
||||
static class Checker implements TypeQualifierValidator<Nonnull> {
|
||||
|
||||
public When forConstantValue(Nonnull qualifierqualifierArgument,
|
||||
Object value) {
|
||||
if (value == null)
|
||||
return When.NEVER;
|
||||
return When.ALWAYS;
|
||||
}
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package javax.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifierNickname
|
||||
@Nonnull(when = When.UNKNOWN)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Nullable {
|
||||
|
||||
}
|
||||
compiler/testData/foreignAnnotations/annotations/javax/annotation/ParametersAreNonnullByDefault.java
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
package javax.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
/**
|
||||
* This annotation can be applied to a package, class or method to indicate that
|
||||
* the method parameters in that element are nonnull by default unless there is:
|
||||
* <ul>
|
||||
* <li>An explicit nullness annotation
|
||||
* <li>The method overrides a method in a superclass (in which case the
|
||||
* annotation of the corresponding parameter in the superclass applies)
|
||||
* <li>There is a default parameter annotation (like {@link ParametersAreNullableByDefault})
|
||||
* applied to a more tightly nested element.
|
||||
* </ul>
|
||||
*
|
||||
* @see Nonnull
|
||||
*/
|
||||
@Documented
|
||||
@Nonnull
|
||||
@TypeQualifierDefault(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ParametersAreNonnullByDefault {
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* This qualifier is applied to an annotation to denote that the annotation
|
||||
* should be treated as a type qualifier.
|
||||
*/
|
||||
|
||||
@Documented
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TypeQualifier {
|
||||
|
||||
/**
|
||||
* Describes the kinds of values the qualifier can be applied to. If a
|
||||
* numeric class is provided (e.g., Number.class or Integer.class) then the
|
||||
* annotation can also be applied to the corresponding primitive numeric
|
||||
* types.
|
||||
*/
|
||||
Class<?> applicableTo() default Object.class;
|
||||
|
||||
}
|
||||
Vendored
-20
@@ -1,20 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* This qualifier is applied to an annotation to denote that the annotation
|
||||
* defines a default type qualifier that is visible within the scope of the
|
||||
* element it is applied to.
|
||||
*/
|
||||
|
||||
@Documented
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TypeQualifierDefault {
|
||||
ElementType[] value() default {};
|
||||
}
|
||||
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* This annotation is applied to a annotation, and marks the annotation as being
|
||||
* a qualifier nickname. Applying a nickname annotation X to a element Y should
|
||||
* be interpreted as having the same meaning as applying all of annotations of X
|
||||
* (other than QualifierNickname) to Y.
|
||||
*
|
||||
* <p>
|
||||
* Thus, you might define a qualifier SocialSecurityNumber as follows:
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <code>
|
||||
@Documented
|
||||
@TypeQualifierNickname @Pattern("[0-9]{3}-[0-9]{2}-[0-9]{4}")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SocialSecurityNumber {
|
||||
}
|
||||
</code>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Documented
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
public @interface TypeQualifierNickname {
|
||||
|
||||
}
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface TypeQualifierValidator<A extends Annotation> {
|
||||
/**
|
||||
* Given a type qualifier, check to see if a known specific constant value
|
||||
* is an instance of the set of values denoted by the qualifier.
|
||||
*
|
||||
* @param annotation
|
||||
* the type qualifier
|
||||
* @param value
|
||||
* the value to check
|
||||
* @return a value indicating whether or not the value is an member of the
|
||||
* values denoted by the type qualifier
|
||||
*/
|
||||
public @Nonnull
|
||||
When forConstantValue(@Nonnull A annotation, Object value);
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
/**
|
||||
* Used to describe the relationship between a qualifier T and the set of values
|
||||
* S possible on an annotated element.
|
||||
*
|
||||
* In particular, an issues should be reported if an ALWAYS or MAYBE value is
|
||||
* used where a NEVER value is required, or if a NEVER or MAYBE value is used
|
||||
* where an ALWAYS value is required.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public enum When {
|
||||
/** S is a subset of T */
|
||||
ALWAYS,
|
||||
/** nothing definitive is known about the relation between S and T */
|
||||
UNKNOWN,
|
||||
/** S intersection T is non empty and S - T is nonempty */
|
||||
MAYBE,
|
||||
/** S intersection T is empty */
|
||||
NEVER;
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2013 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package lombok;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* If put on a parameter, lombok will insert a null-check at the start of the method / constructor's body, throwing a
|
||||
* {@code NullPointerException} with the parameter's name as message. If put on a field, any generated method assigning
|
||||
* a value to this field will also produce these nullchecks.
|
||||
* <p>
|
||||
* Note that any annotation named {@code NonNull} with any casing and any package will result in nullchecks produced for
|
||||
* generated methods (and the annotation will be copied to the getter return type and any parameters of generated methods),
|
||||
* but <em>only</em> this annotation, if present on a parameter, will result in a null check inserted into your otherwise
|
||||
* handwritten method.
|
||||
*
|
||||
* WARNING: If the java community ever does decide on supporting a single {@code @NonNull} annotation (for example via JSR305), then
|
||||
* this annotation will <strong>be deleted</strong> from the lombok package. If the need to update an import statement scares
|
||||
* you, you should use your own annotation named {@code @NonNull} instead of this one.
|
||||
*/
|
||||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@Documented
|
||||
public @interface NonNull {
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011, 2013 Stephan Herrmann and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Stephan Herrmann - initial API and implementation
|
||||
* IBM Corporation - bug fixes
|
||||
*******************************************************************************/
|
||||
package org.eclipse.jdt.annotation;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Qualifier for a type in a method signature or a local variable declaration:
|
||||
* The entity (return value, parameter, field, local variable) whose type has this
|
||||
* annotation can never have the value <code>null</code> at runtime.
|
||||
* <p>
|
||||
* This has two consequences:
|
||||
* <ol>
|
||||
* <li>Dereferencing the entity is safe, i.e., no <code>NullPointerException</code> can occur at runtime.</li>
|
||||
* <li>An attempt to bind a <code>null</code> value to the entity is a compile time error.</li>
|
||||
* </ol>
|
||||
* For the second case, diagnostics issued by the compiler should distinguish three situations:
|
||||
* <ol>
|
||||
* <li>Nullness of the value can be statically determined, the entity is definitely bound from either of:
|
||||
* <ul><li>the value <code>null</code>, or</li>
|
||||
* <li>an entity with a {@link Nullable @Nullable} type.</li></ul></li>
|
||||
* <li>Nullness cannot definitely be determined, because different code branches yield different results.</li>
|
||||
* <li>Nullness cannot be determined, because other program elements are involved for which
|
||||
* null annotations are lacking.</li>
|
||||
* </ol>
|
||||
* </p>
|
||||
* @since 1.0
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@Target({ FIELD, METHOD, PARAMETER, LOCAL_VARIABLE })
|
||||
public @interface NonNull {
|
||||
// marker annotation with no members
|
||||
}
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011, 2013 Stephan Herrmann and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Stephan Herrmann - initial API and implementation
|
||||
* IBM Corporation - bug fixes
|
||||
*******************************************************************************/
|
||||
package org.eclipse.jdt.annotation;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Qualifier for a type in a method signature or a local variable declaration:
|
||||
* The entity (return value, parameter, field, local variable) whose type has this
|
||||
* annotation is allowed to have the value <code>null</code> at runtime.
|
||||
* <p>
|
||||
* This has two consequences:
|
||||
* <ul>
|
||||
* <li>Binding a <code>null</code> value to the entity is legal.</li>
|
||||
* <li>Dereferencing the entity is unsafe, i.e., a <code>NullPointerException</code> can occur at runtime.</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
* @since 1.0
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@Target({ FIELD, METHOD, PARAMETER, LOCAL_VARIABLE })
|
||||
public @interface Nullable {
|
||||
// marker annotation with no members
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package javax.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifierNickname
|
||||
@Nonnull(when = When.MAYBE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface CheckForNull {
|
||||
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package javax.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifier;
|
||||
import javax.annotation.meta.TypeQualifierValidator;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifier
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Nonnull {
|
||||
When when() default When.ALWAYS;
|
||||
|
||||
static class Checker implements TypeQualifierValidator<Nonnull> {
|
||||
|
||||
public When forConstantValue(Nonnull qualifierqualifierArgument,
|
||||
Object value) {
|
||||
if (value == null)
|
||||
return When.NEVER;
|
||||
return When.ALWAYS;
|
||||
}
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package javax.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifierNickname
|
||||
@Nonnull(when = When.UNKNOWN)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Nullable {
|
||||
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package javax.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
/**
|
||||
* This annotation can be applied to a package, class or method to indicate that
|
||||
* the method parameters in that element are nonnull by default unless there is:
|
||||
* <ul>
|
||||
* <li>An explicit nullness annotation
|
||||
* <li>The method overrides a method in a superclass (in which case the
|
||||
* annotation of the corresponding parameter in the superclass applies)
|
||||
* <li>There is a default parameter annotation (like {@link ParametersAreNullableByDefault})
|
||||
* applied to a more tightly nested element.
|
||||
* </ul>
|
||||
*
|
||||
* @see Nonnull
|
||||
*/
|
||||
@Documented
|
||||
@Nonnull
|
||||
@TypeQualifierDefault(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ParametersAreNonnullByDefault {
|
||||
}
|
||||
Vendored
-27
@@ -1,27 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* This qualifier is applied to an annotation to denote that the annotation
|
||||
* should be treated as a type qualifier.
|
||||
*/
|
||||
|
||||
@Documented
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TypeQualifier {
|
||||
|
||||
/**
|
||||
* Describes the kinds of values the qualifier can be applied to. If a
|
||||
* numeric class is provided (e.g., Number.class or Integer.class) then the
|
||||
* annotation can also be applied to the corresponding primitive numeric
|
||||
* types.
|
||||
*/
|
||||
Class<?> applicableTo() default Object.class;
|
||||
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* This qualifier is applied to an annotation to denote that the annotation
|
||||
* defines a default type qualifier that is visible within the scope of the
|
||||
* element it is applied to.
|
||||
*/
|
||||
|
||||
@Documented
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TypeQualifierDefault {
|
||||
ElementType[] value() default {};
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* This annotation is applied to a annotation, and marks the annotation as being
|
||||
* a qualifier nickname. Applying a nickname annotation X to a element Y should
|
||||
* be interpreted as having the same meaning as applying all of annotations of X
|
||||
* (other than QualifierNickname) to Y.
|
||||
*
|
||||
* <p>
|
||||
* Thus, you might define a qualifier SocialSecurityNumber as follows:
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <code>
|
||||
@Documented
|
||||
@TypeQualifierNickname @Pattern("[0-9]{3}-[0-9]{2}-[0-9]{4}")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SocialSecurityNumber {
|
||||
}
|
||||
</code>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Documented
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
public @interface TypeQualifierNickname {
|
||||
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface TypeQualifierValidator<A extends Annotation> {
|
||||
/**
|
||||
* Given a type qualifier, check to see if a known specific constant value
|
||||
* is an instance of the set of values denoted by the qualifier.
|
||||
*
|
||||
* @param annotation
|
||||
* the type qualifier
|
||||
* @param value
|
||||
* the value to check
|
||||
* @return a value indicating whether or not the value is an member of the
|
||||
* values denoted by the type qualifier
|
||||
*/
|
||||
public @Nonnull
|
||||
When forConstantValue(@Nonnull A annotation, Object value);
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package javax.annotation.meta;
|
||||
|
||||
/**
|
||||
* Used to describe the relationship between a qualifier T and the set of values
|
||||
* S possible on an annotated element.
|
||||
*
|
||||
* In particular, an issues should be reported if an ALWAYS or MAYBE value is
|
||||
* used where a NEVER value is required, or if a NEVER or MAYBE value is used
|
||||
* where an ALWAYS value is required.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public enum When {
|
||||
/** S is a subset of T */
|
||||
ALWAYS,
|
||||
/** nothing definitive is known about the relation between S and T */
|
||||
UNKNOWN,
|
||||
/** S intersection T is non empty and S - T is nonempty */
|
||||
MAYBE,
|
||||
/** S intersection T is empty */
|
||||
NEVER;
|
||||
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package org.checkerframework.checker.nullness.qual;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
|
||||
/**
|
||||
* {@link NonNull} is a type annotation that indicates that an expression is
|
||||
* never {@code null}.
|
||||
*
|
||||
* <p>
|
||||
* For fields of a class, the {@link NonNull} annotation indicates that this
|
||||
* field is never {@code null}
|
||||
* <em>after the class has been fully initialized</em>. Class initialization is
|
||||
* controlled by the Freedom Before Commitment type system, see
|
||||
* {@link InitializationChecker} for more details.
|
||||
*
|
||||
* <p>
|
||||
* For static fields, the {@link NonNull} annotation indicates that this field
|
||||
* is never {@code null} <em>after the containing class is initialized</em>.
|
||||
*
|
||||
* <p>
|
||||
* This annotation is rarely written in source code, because it is the default.
|
||||
*
|
||||
* <p>
|
||||
* This annotation is associated with the {@link AbstractNullnessChecker}.
|
||||
*
|
||||
* @see Nullable
|
||||
* @see MonotonicNonNull
|
||||
* @see AbstractNullnessChecker
|
||||
* @checker_framework.manual #nullness-checker Nullness Checker
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE_USE, ElementType.TYPE_PARAMETER })
|
||||
public @interface NonNull {
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
package org.checkerframework.checker.nullness.qual;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
|
||||
/**
|
||||
* {@link Nullable} is a type annotation that indicates that the value is not
|
||||
* known to be non-null (see {@link NonNull}). Only if an expression has a
|
||||
* {@link Nullable} type may it be assigned {@code null}.
|
||||
*
|
||||
* <p>
|
||||
* This annotation is associated with the {@link AbstractNullnessChecker}.
|
||||
*
|
||||
* @see NonNull
|
||||
* @see MonotonicNonNull
|
||||
* @see AbstractNullnessChecker
|
||||
* @checker_framework.manual #nullness-checker Nullness Checker
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE_USE, ElementType.TYPE_PARAMETER })
|
||||
public @interface Nullable {
|
||||
}
|
||||
Vendored
-55
@@ -1,55 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011, 2013 Stephan Herrmann and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Stephan Herrmann - initial API and implementation
|
||||
* IBM Corporation - bug fixes
|
||||
*******************************************************************************/
|
||||
package org.eclipse.jdt.annotation;
|
||||
|
||||
import static java.lang.annotation.ElementType.TYPE_USE;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Qualifier for a reference type in a {@link ElementType#TYPE_USE TYPE_USE} position:
|
||||
* The type that has this annotation is intended to not include the value <code>null</code>.
|
||||
* <p>
|
||||
* If annotation based null analysis is enabled using this annotation has two consequences:
|
||||
* </p>
|
||||
* <ol>
|
||||
* <li>Dereferencing an expression of this type is safe, i.e., no <code>NullPointerException</code> can occur at runtime.</li>
|
||||
* <li>An attempt to bind a <code>null</code> value to an entity (field, local variable, method parameter or method return value)
|
||||
* of this type is a compile time error.</li>
|
||||
* </ol>
|
||||
* For the second case, diagnostics issued by the compiler should distinguish three situations:
|
||||
* <ol>
|
||||
* <li>Nullness of the value can be statically determined, the entity is definitely bound from either of:
|
||||
* <ul><li>the value <code>null</code>, or</li>
|
||||
* <li>an entity with a {@link Nullable @Nullable} type.</li></ul></li>
|
||||
* <li>Nullness cannot definitely be determined, because different code branches yield different results.</li>
|
||||
* <li>Nullness cannot be determined, because other program elements are involved for which
|
||||
* null annotations are lacking.</li>
|
||||
* </ol>
|
||||
* <p>
|
||||
* <b>Note:</b> Since org.eclipse.jdt.annotation 2.0.0, the
|
||||
* <code>@Target</code> is <code>{TYPE_USE}</code>. For the old API, see
|
||||
* <a href="http://help.eclipse.org/kepler/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/annotation/NonNull.html">
|
||||
* <code>@NonNull</code> in 1.1.0</a>.
|
||||
* </p>
|
||||
* @since 1.0
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@Target({ TYPE_USE })
|
||||
public @interface NonNull {
|
||||
// marker annotation with no members
|
||||
}
|
||||
Vendored
-46
@@ -1,46 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011, 2013 Stephan Herrmann and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Stephan Herrmann - initial API and implementation
|
||||
* IBM Corporation - bug fixes
|
||||
*******************************************************************************/
|
||||
package org.eclipse.jdt.annotation;
|
||||
|
||||
import static java.lang.annotation.ElementType.TYPE_USE;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Qualifier for a reference type in a {@link ElementType#TYPE_USE TYPE_USE} position:
|
||||
* The type that has this annotation explicitly includes the value <code>null</code>.
|
||||
* <p>
|
||||
* If annotation based null analysis is enabled using this annotation has two consequences:
|
||||
* </p>
|
||||
* <ol>
|
||||
* <li>Binding a <code>null</code> value to an entity (field, local variable, method parameter or method return value)
|
||||
* of this type is legal.</li>
|
||||
* <li>Dereferencing an expression of this type is unsafe, i.e., a <code>NullPointerException</code> can occur at runtime.</li>
|
||||
* </ol>
|
||||
* <p>
|
||||
* <b>Note:</b> Since org.eclipse.jdt.annotation 2.0.0, the
|
||||
* <code>@Target</code> is <code>{TYPE_USE}</code>. For the old API, see
|
||||
* <a href="http://help.eclipse.org/kepler/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/annotation/Nullable.html">
|
||||
* <code>@Nullable</code> in 1.1.0</a>.
|
||||
* </p>
|
||||
* @since 1.0
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@Target({ TYPE_USE })
|
||||
public @interface Nullable {
|
||||
// marker annotation with no members
|
||||
}
|
||||
Reference in New Issue
Block a user