Unify Java harness validation error messages

Đang mở
#872 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@weichieh0204 đang làm issue này rồi.

Từ ngày 26/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Java harness validation errors include the exception class name, while the equivalent checks in C, C++, JavaScript and Python report the message alone. This follow-up covers the existing Java checks together rather than changing only the ancestor guard in #846.

At PR #846 head 5bdd0551268c4c3d8e55e7cc8776e688f533f70a, javaCase in web/compiler-explorer.js serializes caught exceptions with error.toString(). The ancestor guard therefore reports:

java.lang.IllegalArgumentException: Returned ancestor must be an original input node.

The other four runners report:

Returned ancestor must be an original input node.

Existing Java graph, list and tree validation checks use the same exception convention. Tests currently accommodate the prefix with endsWith. These observations are based on source inspection; no additional runtime reproduction was performed for this draft.

Introduce a dedicated harness-validation exception, such as the HarnessCheck suggested in the review comment, whose toString() returns only its message. Use it consistently for harness validation failures while preserving the exception class name for errors thrown by candidate code.

Acceptance criteria:

  • Equivalent harness refusals have exactly matching error text across the five runners, including ancestor identity, graph and list checks.
  • Candidate-thrown exceptions, including IllegalArgumentException, retain their class name and message.
  • Regression tests use exact equality for harness messages and cover candidate-thrown exceptions separately.
  • Valid answers, null-result handling and continuation after a per-case refusal retain their existing behavior.

Related work: #725 addresses null graph neighbors; #783 addresses Python and JavaScript runtime-error locations. This follow-up concerns Java harness error formatting.

Ngôn ngữ chính
Rust
Star
236
Fork
153
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
187

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sysprog21/codetrial

Tất cả issue của sysprog21/codetrial

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.