• <legend id='jvkq7'><style id='jvkq7'><dir id='jvkq7'><q id='jvkq7'></q></dir></style></legend>
    1. <tfoot id='jvkq7'></tfoot>

        <i id='jvkq7'><tr id='jvkq7'><dt id='jvkq7'><q id='jvkq7'><span id='jvkq7'><b id='jvkq7'><form id='jvkq7'><ins id='jvkq7'></ins><ul id='jvkq7'></ul><sub id='jvkq7'></sub></form><legend id='jvkq7'></legend><bdo id='jvkq7'><pre id='jvkq7'><center id='jvkq7'></center></pre></bdo></b><th id='jvkq7'></th></span></q></dt></tr></i><div id='jvkq7'><tfoot id='jvkq7'></tfoot><dl id='jvkq7'><fieldset id='jvkq7'></fieldset></dl></div>

        <small id='jvkq7'></small><noframes id='jvkq7'>

          <bdo id='jvkq7'></bdo><ul id='jvkq7'></ul>

        Sonarqube,“字符串不包含格式说明符"记录常量字符串消息时

        Sonarqube, quot;String contains no format specifiersquot; when logging constant String message(Sonarqube,“字符串不包含格式说明符记录常量字符串消息时)
      1. <tfoot id='p7vV0'></tfoot>
        <i id='p7vV0'><tr id='p7vV0'><dt id='p7vV0'><q id='p7vV0'><span id='p7vV0'><b id='p7vV0'><form id='p7vV0'><ins id='p7vV0'></ins><ul id='p7vV0'></ul><sub id='p7vV0'></sub></form><legend id='p7vV0'></legend><bdo id='p7vV0'><pre id='p7vV0'><center id='p7vV0'></center></pre></bdo></b><th id='p7vV0'></th></span></q></dt></tr></i><div id='p7vV0'><tfoot id='p7vV0'></tfoot><dl id='p7vV0'><fieldset id='p7vV0'></fieldset></dl></div>

          <legend id='p7vV0'><style id='p7vV0'><dir id='p7vV0'><q id='p7vV0'></q></dir></style></legend>
              <bdo id='p7vV0'></bdo><ul id='p7vV0'></ul>

                    <tbody id='p7vV0'></tbody>

                  <small id='p7vV0'></small><noframes id='p7vV0'>

                1. 本文介绍了Sonarqube,“字符串不包含格式说明符"记录常量字符串消息时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  SonarQube 抱怨字符串不包含格式说明符."使用 org.slf4j.Logger 时,特别是方法public void debug(String msg)".例如

                  SonarQube complains about "String contains no format specifiers." when using org.slf4j.Logger, in particular method "public void debug(String msg)". For example

                   log.info("message");
                  

                  参考这条规则:https://wiki.sei.cmu.edu/confluence/display/c/FIO47-C.+Use+valid+format+strings

                  但是,在这条规则中,我们可以找到以下引用:

                  However, in this rule, we can find the following quote :

                  每个转换规范都由 % 字符引入紧随其后(按顺序)

                  Each conversion specification is introduced by the % character followed (in order) by

                  零个或多个标志(以任何顺序),它们修改了转换规范

                  Zero or more flags (in any order), which modify the meaning of the conversion specification

                  是我遗漏了什么,还是这条规则没有很好地执行?有这方面的经验吗?

                  Is it me that miss something, or is this rule not well implemented? Any experience with that ?

                  推荐答案

                  这是 SonarJava 5.1 引入的一个已知问题.您可以放心地将此问题视为误报 (FP) 和/或忽略它.在处理 JIRA 票证 SONARJAVA-2633 时已修复此问题.

                  This is a known issue introduced with SonarJava 5.1. You can safely consider this issue as a False Positive (FP) and/or ignore it. It has already been fixed while handling JIRA ticket SONARJAVA-2633.

                  该修复程序已与 2018 年 2 月 16 日发布的 5.1.1 版 SonarJava 分析器一起提供(需要 SonarQube LTS 6.7 或更高版本).

                  The fix has been delivered with version 5.1.1 of SonarJava analyzer, released on Feb 16, 2018 (requires SonarQube LTS 6.7 or superior).

                  SonarLint 独立用户更新

                  对于使用独立版本(未连接到任何 SonarQube 实例)的 SonarLint 用户,您可能仍会根据所使用的版本观察到问题.如果您正在使用:

                  For SonarLint users working with standalone versions (not connected to any SonarQube instance), you may still observe the issue depending of the version you are using. If you are using:

                  • SonarLint for Eclipse 3.5:它包含 SonarJava 的 5.1.0.13090 版本,因此您仍会在代码中观察到 FP.下一个版本将使用更新版本的 SonarJava,从而解决该问题.下一版本预计将于 2018 年 5 月底/6 月初发布.
                  • SonarLint for IntelliJ 3.4(2018 年 5 月 9 日发布):包含 SonarJava 5.3.0.13828,表示该问题已修复.将您的版本更新到最新发布的版本应该可以解决该问题.
                  • SonarLint for Eclipse 3.5: It includes version 5.1.0.13090 of SonarJava, so you will still observe the FP on your code. Next release will use a more recent version of SonarJava, therefore resolving the issue. Next version is expected for end of May/early June 2018.
                  • SonarLint for IntelliJ 3.4 (released on May 9, 2018): It includes SonarJava 5.3.0.13828, which means that the issue has been fixed. Updating your version to latest released version should then fix the issue.

                  这篇关于Sonarqube,“字符串不包含格式说明符"记录常量字符串消息时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Slf4j LoggerFactory.getLogger and sonarqube(Slf4j LoggerFactory.getLogger 和 sonarqube)
                  Security - Array is stored directly(安全性 - 数组直接存储)
                  SonarQube quot;Class Not Foundquot; during Main AST Scan(SonarQube“找不到类在主 AST 扫描期间)
                  Integrate Spock#39;s test with Sonar(将 Spock 的测试与声纳集成)
                  How do I make Hudson/Jenkins fail if Sonar thresholds are breached?(如果违反声纳阈值,我如何让 Hudson/Jenkins 失败?)
                  automatically add curly brackets to all if/else/for/while etc. in a java code-base(自动将大括号添加到 java 代码库中的所有 if/else/for/while 等)

                  <i id='WcnCb'><tr id='WcnCb'><dt id='WcnCb'><q id='WcnCb'><span id='WcnCb'><b id='WcnCb'><form id='WcnCb'><ins id='WcnCb'></ins><ul id='WcnCb'></ul><sub id='WcnCb'></sub></form><legend id='WcnCb'></legend><bdo id='WcnCb'><pre id='WcnCb'><center id='WcnCb'></center></pre></bdo></b><th id='WcnCb'></th></span></q></dt></tr></i><div id='WcnCb'><tfoot id='WcnCb'></tfoot><dl id='WcnCb'><fieldset id='WcnCb'></fieldset></dl></div>

                    <legend id='WcnCb'><style id='WcnCb'><dir id='WcnCb'><q id='WcnCb'></q></dir></style></legend>

                    <small id='WcnCb'></small><noframes id='WcnCb'>

                        <tbody id='WcnCb'></tbody>
                          <bdo id='WcnCb'></bdo><ul id='WcnCb'></ul>

                        • <tfoot id='WcnCb'></tfoot>