TestExamples crashes on a diagnostic without a source position

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

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

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

評価

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

調査の方向性

The crash is in TestExamples.matches, where diagnostic.getPosition().getLine() dereferences a null position for the "Java compilation encountered issues" warning. Start there and run the TestExamples test suite with a reproducer that emits that warning. Done means an unmatched position-less diagnostic reports the "unexpected diagnostic" failure instead of throwing a NullPointerException. The fixture syntax for expecting a position-less warning is not settled in the issue, so agree on it with the maintainers before adding it.

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

説明

bug

Impact: test-only. Reproducers that produce the "Java compilation encountered issues" warning cannot become test fixtures. It blocked fixtures for #390 and #345.

Description

TestExamples.matches calls diagnostic.getPosition().getLine(). The compilation warning has no position, so the test crashes with a NullPointerException instead of failing with the "unexpected diagnostic" message, and an expected position-less warning cannot be declared.

Possible fix

Treat a diagnostic without a position as unmatched (return false), and decide how a fixture expects a position-less warning (e.g. a file-level // Expect: Warning comment).

主要言語
Java
スター
73
フォーク
38
平均マージ
12時間 32分
マージ済み PR(30日)
45

環境構築

はじめの一歩

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

liquid-java/liquidjava のほかの issue

liquid-java/liquidjava の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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