exercism / exercism/java-analyzer

Analyzer feedback for reformat method in LogLevels flags .formatted() specifically as String.format

未关闭
#355 3 条评论 0 个 reaction 已指派 1 人 已被 @Thakurji890 认领 在 GitHub 查看
主要语言
Java
星标
13
派生
27
平均合并
4 天 9 小时
30 天内合并 PR
6

描述

In the LogLevels exercise (Java track), I used the Java 15+ instance method String.formatted() to concatenate the final log message in the reformat method:

`return "%s (%s)".formatted(textMsg, textLevel);`

The automated Java Analyzer flagged this and suggested using the + operator for performance reasons. However, the feedback message explicitly references the older static method String.format instead of the one I actually used (.formatted()).

While I understand the performance suggestion to use standard string concatenation (+) for simple cases, the analyzer's feedback text should ideally recognize the .formatted() method or be reworded to encompass both formatting approaches to avoid confusion.

Just a minor tweak for the analyzer's message accuracy! Thanks for maintaining this track.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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