Skip to content

Commit

Permalink
close #130: no more JSR305, we recommend SpotBugs internal annotation…
Browse files Browse the repository at this point in the history
… instead
  • Loading branch information
KengoTODA committed May 25, 2017
1 parent 533b6be commit 51e941f
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 53 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@ This is the changelog for SpotBugs. This follows [Keep a Changelog v0.3](http://

## Unreleased (2017/??/??)

### Changed

* SpotBugs annotation is recommended instead of JSR305 annotation ([#130](https://github.com/spotbugs/spotbugs/pull/130))

### Fixed

* Fix wrong version in Eclipse Plugin ([#173](https://github.com/spotbugs/spotbugs/pull/173))
Expand Down
6 changes: 6 additions & 0 deletions spotbugs-annotations/build-template.properties
@@ -0,0 +1,6 @@
src.excludes=META-INF/MANIFEST-TEMPLATE.MF
bin.includes=META-INF/
jars.compile.order=spotbugs-annotations.jar
src.includes=META-INF/
output.spotbugs-annotations.jar=bin_eclipse/
bin.excludes=META-INF/MANIFEST-TEMPLATE.MF
Expand Up @@ -33,15 +33,12 @@
*
* 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 {

}
Expand Up @@ -29,13 +29,10 @@
* be checked when invoking the method.
*
* The checker treats this annotation as inherited by overriding methods.
*
* @deprecated - use {@link javax.annotation.CheckReturnValue} instead.
*/
@Documented
@Target({ ElementType.METHOD, ElementType.CONSTRUCTOR })
@Retention(RetentionPolicy.CLASS)
@Deprecated
public @interface CheckReturnValue {

@Deprecated
Expand Down
Expand Up @@ -41,28 +41,12 @@
* package, and then use @Nullable only on those parameters, methods or fields
* that you want to allow to be null.
*
* @deprecated - Use the JSR305 annotations instead.
* For example, you can use {@link javax.annotation.ParametersAreNonnullByDefault} instead
* of @DefaultAnnotation(NonNull.class) so that method parameters are nonnull by default in the annotated
* element. You can also use {@link javax.annotation.meta.TypeQualifierDefault}
* in general to define your own annotation that specifies a default type qualifier. For example,
* <p><pre><code>
* {@link Nonnegative}
* {@link TypeQualifierDefault}({@link ElementType#PARAMETER})
* public @interface ParametersAreNonnegativeByDefault {}
* </code></pre>
*
* <p>The JSR305 {@link javax.annotation.CheckReturnValue}
* annotation can be applied to a type or package, and it will act as a default for all methods
* in that class or package unless otherwise overridden.
*
* @author William Pugh
*/

@Documented
@Target({ ElementType.TYPE, ElementType.PACKAGE })
@Retention(RetentionPolicy.CLASS)
@Deprecated
public @interface DefaultAnnotation {
Class<? extends Annotation>[] value();

Expand Down
Expand Up @@ -37,20 +37,12 @@
* package, and then use @Nullable only on those parameters, methods or fields
* that you want to allow to be null.
*
* @deprecated - use the JSR305 annotations instead,
* For example, you can use {@link javax.annotation.ParametersAreNonnullByDefault} instead
* of @DefaultAnnotation(NonNull.class), and {@link javax.annotation.meta.TypeQualifierDefault}
* in general to define a type qualifier default. The JSR305 {@link javax.annotation.CheckReturnValue}
* annotation can be applied to a type or package, and it will act as a default for all methods
* in that class or package unless otherwise overridden.
*
* @author William Pugh
*/

@Documented
@Target({ ElementType.TYPE, ElementType.PACKAGE })
@Retention(RetentionPolicy.CLASS)
@Deprecated
public @interface DefaultAnnotationForParameters {
Class<? extends Annotation>[] value();

Expand Down
Expand Up @@ -32,15 +32,12 @@
*
* 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 {

}
Expand Up @@ -36,15 +36,12 @@
*
* 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 {

}
Expand Up @@ -35,11 +35,8 @@
* overriding method.
*
* @see edu.umd.cs.findbugs.annotations.When
*
* @deprecated - Use {@link javax.annotation.OverridingMethodsMustInvokeSuper} instead
**/
@Documented
@Deprecated
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.CLASS)
public @interface OverrideMustInvoke {
Expand Down
@@ -1,18 +1,6 @@
/**
* Annotations for FindBugs (mostly deprecated except for {@link edu.umd.cs.findbugs.annotations.SuppressFBWarnings}).
*
* This annotations are mostly deprecated and replaced by JSR 305 annotations
* defined in javax.annotation. The annotations still actively supported are:
* <ul>
* <li> {@link edu.umd.cs.findbugs.annotations.SuppressFBWarnings} for suppressing FindBugs warnings
* <li> Annotations about expected/unexpected warnings in FindBugs regression tests
* <ul>
* <li> {@link edu.umd.cs.findbugs.annotations.ExpectWarning} Warnings expected to be generated
* <li> {@link edu.umd.cs.findbugs.annotations.NoWarning} Warnings that should not be generated
* <li> {@link edu.umd.cs.findbugs.annotations.DesireWarning} Warnings we wish to generated
* <li> {@link edu.umd.cs.findbugs.annotations.DesireNoWarning} Warnings we wish to not generate generated
* </ul></ul>
*
* There are another set of annotations used by an experimental detector for unclosed resources:
* <ul>
* <li>{@link edu.umd.cs.findbugs.annotations.CleanupObligation}
Expand All @@ -22,4 +10,3 @@
*/
package edu.umd.cs.findbugs.annotations;

1 change: 0 additions & 1 deletion spotbugs/build.gradle
Expand Up @@ -210,7 +210,6 @@ ant.importBuild('build.xml') { antTargetName ->
'ant-' + antTargetName
}

// TODO : jsr305.jar (really?)
// TODO : generatemanual (we should decide what to do with the manual)
// TODO : generatepdfmanual
// TODO : bugdesc
Expand Down

0 comments on commit 51e941f

Please sign in to comment.