ExampleTitlesTest fails on Windows: class names are built with '/' only

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

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

@0-two đang làm issue này rồi.

Từ ngày 20/11/2026.

  • #1971 của @0-two — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
testing

Hướng nghiên cứu

Open ExampleTitlesTest in wicket-examples and read examplePages() (around line 106) and load() (around line 114), where a .class file's relative Path is turned into a class name with .replace('/', '.'). Run mvn verify -pl wicket-examples on Windows, or reason from Path.toString() using \, to reproduce the NoClassDefFound/wrong-name error. Done means class names are built separator-independently (e.g. from the path segments rather than the string) and the test passes on Windows. Note that pull request #1971 is already open against this, so coordinate before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

On Windows, mvn verify fails in wicket-examples:

ExampleTitlesTest.everyExamplePageHasATitle:54->examplePages:106->load:114 »
NoClassDefFound org/apache/wicket/examples/ajax\builtin\AjaxApplication$1
(wrong name: org/apache/wicket/examples/ajax/builtin/AjaxApplication$1)
Cause

examplePages() turns each .class file's relative Path into a class name with
.replace('/', '.'). On Windows, Path.toString() uses \ as the separator, so the
backslashes stay in the name and Class.forName fails. Linux and macOS are not
affected, and CI runs only on Ubuntu, so it does not show up there.

The test was added in f64a9ce2af ("Let every example describe itself, and build the
indexes from that").

Environment

Windows 11, JDK 25, Maven 3.10.0, current master.

Ngôn ngữ chính
Java
Star
800
Fork
437
Merge trung bình
21 giờ 36 phút
Pull request đã merge (30 ngày)
167

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 apache/wicket

Tất cả issue của apache/wicket

Issue tương tự

Thêm issue về Java

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.