在 AUTO 模式下补充 Java 版本告警,并记住用户接受的选择(#6799) - #6801
Open
Chen-Mengze wants to merge 14 commits into
Open
Conversation
Member
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18630e5ae7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
平台不支持时保留当前 Java 继续启动,不取消。 Join 之后再把 FX 队列 flush 掉(runLater 是 FIFO,插一个 latch 并 await 即可),顺便给 logs 的读取加锁。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
针对 #6799,在 AUTO 模式下补充 Java 版本告警,并在用户接受风险后按实例记住选择,仅在因此崩溃时重新提醒。
主要修改
1. 新增诊断组件(HMCLCore,纯函数,与选 Java 完全解耦)
JavaCompatibility:诊断结果 record(targetMajor / actualMajor / Level)。JavaCompatibilityEvaluator:纯函数,无 IO、无 UI、无设置访问。仅由LauncherHelper在拿到 Java 后调用,"找 Java" 与 "要不要问用户" 两件事彻底分离,未改动JavaManager与JavaVersionConstraint。2. 目标版本取自 Mojang 官方声明,不再硬编码区间
manifest.javaVersion()是 version.json 自带的权威要求,MC 出新版本时零改动生效。上界 = 目标版本 + 容忍档位,按
ModLoaderType以数据表配置(新增加载器 = 加 1 行,调优 = 改 1 个数字),不再是MODDED_JAVA_*那种写死的三段字面量区间。3. LauncherHelper AUTO 分支接入
仅在
JavaVersionType.AUTO下校验——HMCL 自己做决策时才有义务告知;手动指定的用户已知情,不打扰。命中时弹窗,提供一键修正:已装对应版本则直接切换,否则复用
downloadJava下载。修正动作不调用setJavaAutoSelected(),避免把用户踢回 AUTO 后警告永久消失。4. 实例级记住,崩溃时重新武装
点「否」后按
actualMajor:expectedMajor写入实例级设置(组合变化即重新提醒,避免一次性静默到永远)。崩溃撤回复用
CrashReportAnalyzer现有规则(JAVA_VERSION_IS_TOO_HIGH、JDK_9、NEED_JDK11、MODLAUNCHER_8、TOO_OLD_JAVA、MAC_JDK_8U261),不新增正则、不重复造轮子。与 Java 无关的崩溃保持静默,不做无谓打扰。5. 翻译
launch.advice.switch_java新增 10 语;解释部分复用已有的launch.advice.modded_java(上游已译 9 语),并补上日语缺失的该条目。设计取舍
CrashReportAnalyzer,规则由上游维护,新增特征自动生效。测试
1.20.1 Forge + 仅 Java 25 → 期望 17、Forge 容忍 1 档(上限 21),25 > 21 → 触发提示。
25:17,后续启动不再弹Unsupported class file major version崩溃:下次重新提醒