CommandLineLauncher exits with status 0 when verification fails
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
liquidjava.api.CommandLineLauncher.main から始め、issue で示されている diagnostics.foundError() の分岐を特定します。検証エラーが 0 以外の終了ステータスを返すように、コマンドライン部分のエントリーポイントだけを変更し、launch(...) は VS Code Language Server から引き続き利用できるようにしてください。提供されている無効な Java ファイルと有効なファイルで検証し、echo $? が無効なファイルでのみ失敗を示すことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Description
liquidjava.api.CommandLineLauncher always exits with status 0, also when verification finds errors. Scripts, CI jobs and build tools that run the verifier (for example through exec-maven-plugin) therefore cannot tell a failed verification from a passing one by the exit code, and a refinement error never fails the build.
In CommandLineLauncher.main, the error branch prints the diagnostics and returns:
if (diagnostics.foundError()) {
System.out.println(diagnostics.getErrorOutput());
return;
}
Minimal reproducer
import liquidjava.specification.Refinement;
final class Bad {
static void f() {
@Refinement("_ > 0")
int a = -1;
}
}
java -cp liquidjava-verifier/target/liquidjava-verifier-0.0.38.jar \
liquidjava.api.CommandLineLauncher path/to/folder-with-Bad.java
echo $?
The same happens with the ./liquidjava script and with mvn exec:java (liquidjava.api.CommandLineLauncher as mainClass).
Expected behavior
A non-zero exit status when verification reports errors, and 0 when it passes.
Actual behavior
The error is printed correctly:
Refinement Error: found `a == -1` but expected `a > 0`
5 | @Refinement("_ > 0")
but echo $? prints 0, the same as for a correct file (Correct! Passed Verification.).
Environment
- LiquidJava version / commit: 0.0.38, built from
mainat 6a349c1e (2026-11-24); also withio.github.liquid-java:liquidjava-verifier:0.0.38from Maven Central - Java version (
java -version): OpenJDK 21.0.13 (Temurin, in Docker) and OpenJDK 21.0.13.1 (host) - OS: Linux
A possible fix might be to exit with a non-zero status in the error branch of main only. launch(...) is also called by the VS Code extension's language server, so a System.exit there would stop the server.
- 主要言語
- Java
- スター
- 73
- フォーク
- 38
- 平均マージ
- 12時間 32分
- マージ済み PR(30日)
- 45
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
liquid-java/liquidjava のほかの issue
-
A float ghost crashes the verifier: "Ghost not implemented for type float"対応中かも @MohammedZaid1740 が 7 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
liquid-java/liquidjava#443 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug real-world-finding
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
liquid-java/liquidjava#395 ·
メンテナーはふだん 1 日以内に返信
-
A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatible対応中かも @CatarinaGamboa が 4 日前に担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
liquid-java/liquidjava#558 ·
メンテナーはふだん 1 日以内に返信
-
new T[a][b] gets length b instead of a (unsound)対応中かも @CatarinaGamboa が 4 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
liquid-java/liquidjava#557 ·
メンテナーはふだん 1 日以内に返信
-
Invariant inference: mark inferred facts in diagnostics, and a hint to state a loop invariant対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンenhancement error messages
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
liquid-java/liquidjava#554 ·
メンテナーはふだん 1 日以内に返信
liquid-java/liquidjava の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
avaje/avaje-metrics#139 ·
-
documentation good first issue help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Attachment upload accepts a file part with no file chosen and stores an empty comp_attachment対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eclipse-sw360/sw360#4849 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
exoego/keycloak-fuhito#888 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Skip cross-field checkpointing validation rules when checkpointing is disabled対応中かも @hutiefang76 が今日担当しました。 オープンaccepted bug good first issue java
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Sekelenao/Flinkboot#473 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信