JetBrains / JetBrains/java-annotations

Remove redundant targets from Nullability-annotations

オープン
#37 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Kotlin
スター
463
フォーク
72
PR マージ指標
30日以内にマージされた PR はありません

説明

At current both `@NotNull` and `@Nullable` have quite broad scopes which commonly overlap:
https://github.com/JetBrains/java-annotations/blob/d7c469b3b53c2135ba1c8863fc5eb2f5d5ccb36c/common/src/main/java/org/jetbrains/annotations/Nullable.java#L39
https://github.com/JetBrains/java-annotations/blob/d7c469b3b53c2135ba1c8863fc5eb2f5d5ccb36c/common/src/main/java/org/jetbrains/annotations/NotNull.java#L29
While this is required for java5 (which obviously does not have `ElementType.TYPE_USE`) it is more of an issue rather than a feature on java 8+. I.e. overlapping scopes lead to tools such as Javadoc recognizing both targets as matched thus leading to issues such as duplication of the annotation in documentation in case of the latter.

Thus I suggest keeping only `ElementType.TYPE_USE` on these annotations in java8 version of the project, and keeping only `{ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE}` on java5 version.

If this gets approved I am ready to create the corresponding PR.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。