Skip to content

fix: .ToString -> .ToString()#2803

Merged
SALTWOOD merged 1 commit intodevfrom
fix/log-java-selection
May 7, 2026
Merged

fix: .ToString -> .ToString()#2803
SALTWOOD merged 1 commit intodevfrom
fix/log-java-selection

Conversation

@SALTWOOD
Copy link
Copy Markdown
Member

@SALTWOOD SALTWOOD commented May 7, 2026

Summary by Sourcery

错误修复:

  • 通过移除对已选择 Java 对象的不正确 ToString 引用,修正 Java 选择日志记录。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Correct Java selection logging by removing an incorrect ToString reference on the selected Java object.

@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: XS PR 大小评估:微型 labels May 7, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 7, 2026

审阅者指南(在小型 PR 上折叠)

审阅者指南

将错误使用 .ToString 作为属性访问的代码,替换为直接记录 McLaunchJavaSelected 的值,从而在记录所选 Java 时避免潜在的运行时或格式化问题。

文件级更改

更改 详情 文件
修复在记录所选 Java 运行时时对 .ToString 的错误使用。
  • 将原先通过字符串拼接引用 McLaunchJavaSelected.ToString 的写法,替换为直接拼接 McLaunchJavaSelected,并依赖其隐式的 ToString() 实现。
  • 确保日志消息不再将 .ToString 当作属性访问,从而避免潜在的编译期或运行时问题。
Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs

提示与命令

与 Sourcery 交互

  • 触发新的审阅: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 通过回复某条审阅评论,要求 Sourcery 从该评论创建一个 issue。你也可以在审阅评论下回复 @sourcery-ai issue 来基于该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可在任意时间生成标题。你也可以在拉取请求中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文任意位置写入 @sourcery-ai summary,即可在你想要的位置生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可在任意时间(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可一次性解决所有 Sourcery 评论。如果你已经处理了所有评论且不想再看到它们,这会非常有用。
  • 忽略所有 Sourcery 审阅: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审阅。若你想从头开始新的审阅,这特别有用——别忘了再评论 @sourcery-ai review 以触发新的审阅!

自定义你的体验

访问你的 控制面板 以:

  • 启用或禁用审阅功能,例如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、删除或编辑自定义审阅指引。
  • 调整其他审阅设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces an incorrect usage of .ToString property access with direct logging of the McLaunchJavaSelected value, avoiding a likely runtime or formatting issue when logging the selected Java.

File-Level Changes

Change Details Files
Fix incorrect .ToString usage when logging the selected Java runtime.
  • Replace string concatenation that referenced McLaunchJavaSelected.ToString with concatenation using McLaunchJavaSelected directly, relying on its implicit ToString() implementation.
  • Ensure the logged message no longer accesses .ToString as a property, preventing potential compile-time or runtime issues.
Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好——我给出了一些总体反馈:

  • 如果 McLaunchJavaSelected 不是字符串,建议显式调用 .ToString(),以明确转换意图,并避免依赖隐式的字符串拼接行为。
给 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- If `McLaunchJavaSelected` is not a string, consider explicitly calling `.ToString()` to make the conversion intent clear and avoid relying on implicit string concatenation behavior.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,请考虑分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进评审质量。
Original comment in English

Hey - I've left some high level feedback:

  • If McLaunchJavaSelected is not a string, consider explicitly calling .ToString() to make the conversion intent clear and avoid relying on implicit string concatenation behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- If `McLaunchJavaSelected` is not a string, consider explicitly calling `.ToString()` to make the conversion intent clear and avoid relying on implicit string concatenation behavior.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@pcl-ce-automation pcl-ce-automation Bot added 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 and removed 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 labels May 7, 2026
@SALTWOOD SALTWOOD merged commit 8d0f49f into dev May 7, 2026
3 checks passed
@pcl-ce-automation pcl-ce-automation Bot added 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线 and removed 🕑 等待合并 已处理完毕,正在等待代码合并入主分支 labels May 7, 2026
@SALTWOOD SALTWOOD deleted the fix/log-java-selection branch May 7, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS PR 大小评估:微型 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants