Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Class-file CLASS-retention annotations (RuntimeInvisibleAnnotations) are not read: SpotBugs @CheckForNull/@NonNull on library members

オープン
#161 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java, kotlin

調査の方向性

Start with ClassSymbolScanner.loadAnnotations and inspect how it reads library member annotations through javac symbols. Compare that result with the class file's RuntimeInvisibleAnnotations for the JnlpConnectionState.getStash example; the issue suggests the JDK ClassFile API or maddi-java-bytecode as entry points. Done means CLASS-retention annotations such as @CheckForNull and @NonNull are included in the nullability analysis.

索引モデルが issue の本文から書いたものです。

説明

ClassSymbolScanner.loadAnnotations reads a library member's annotations through javac's symbols (symbol.getAnnotationMirrors()). Annotations with CLASS retention are stored in a class file's RuntimeInvisibleAnnotations attribute and do not show up there. kotlinc reads them, so Kotlin sees a nullness that maddi's analysis does not.

Example: jenkins remoting's JnlpConnectionState.getStash(Class<S>) carries edu.umd.cs.findbugs.annotations.CheckForNull (RuntimeInvisibleAnnotations, checked with javap).

  • kotlinc infers val state = event.getStash(State::class.java) as State?.
  • The nullability pass never seeds it: no cause in the jenkins causes run mentions a stapler or remoting annotation, although both use @CheckForNull and @NonNull widely.

Effect on the jenkins J2K trial (2026-10-20): DefaultJnlpSlaveReceiver.kt ×6, likely also Channels.kt:50/76 and JnlpSlaveAgentProtocol4.kt:76.

Type-use annotations in RuntimeVisibleTypeAnnotations (JSpecify) are a separate path, now carried by 21b739d11 on ws/maddi-null.

Possible fix: read RuntimeInvisibleAnnotations of a library member from the class file itself, through the JDK ClassFile API or maddi-java-bytecode, and add those annotations next to the visible ones.

🤖 Generated with Claude Code

主要言語
Java
スター
1
フォーク
1
平均マージ
1時間 58分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CodeLaser/maddi のほかの issue

CodeLaser/maddi の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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