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

未关闭
#1,970 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@0-two 已经在做这个了。

开始于 2026年11月20日。

  • #1971 来自 @0-two —— 未关闭

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
java
领域
testing

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Java
星标
800
派生
437
平均合并
21 小时 36 分钟
30 天内合并 PR
167

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/wicket 的其他 Issue

查看 apache/wicket 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。