Skip to content

Commit

Permalink
Fix #16: Add ElementType.TYPE_PARAMETER targets
Browse files Browse the repository at this point in the history
  • Loading branch information
tlinkowski committed Aug 31, 2019
1 parent 07dab91 commit 173dbc5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ For this purpose, the library provides two annotations in the `pl.tlinkowski.ann
[packages](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/annotation/ElementType.html#PACKAGE)

- affects: **all** [type uses](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/annotation/ElementType.html#TYPE_USE)
(e.g. fields, method return types, method parameters, type parameters, local variables)
(e.g. fields, method return types, method parameters, type parameters, local variables) and
[type parameters](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/annotation/ElementType.html#TYPE_PARAMETER)
*within the annotated package*

- analogous to (except for the scope of affected entities):
Expand All @@ -102,7 +103,8 @@ For this purpose, the library provides two annotations in the `pl.tlinkowski.ann

- [target](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/annotation/Target.html):
[type uses](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/annotation/ElementType.html#TYPE_USE)
(e.g. fields, method return types, method parameters, type parameters, local variables)
(e.g. fields, method return types, method parameters, type parameters, local variables) and
[type parameters](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/annotation/ElementType.html#TYPE_PARAMETER)

- affects: annotated type use

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@Nonnull
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PACKAGE)
@TypeQualifierDefault(ElementType.TYPE_USE)
@TypeQualifierDefault({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@UnderMigration(status = MigrationStatus.STRICT) // https://youtrack.jetbrains.com/issue/KT-10942
public @interface NonNullPackage {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@Documented
@Nonnull(when = When.MAYBE)
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE_USE)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@TypeQualifierNickname
@UnderMigration(status = MigrationStatus.STRICT) // https://youtrack.jetbrains.com/issue/KT-10942
public @interface NullOr {
Expand Down

0 comments on commit 173dbc5

Please sign in to comment.