<tfoot id='Fj9et'></tfoot>

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

    • <bdo id='Fj9et'></bdo><ul id='Fj9et'></ul>

      <legend id='Fj9et'><style id='Fj9et'><dir id='Fj9et'><q id='Fj9et'></q></dir></style></legend>
    1. <i id='Fj9et'><tr id='Fj9et'><dt id='Fj9et'><q id='Fj9et'><span id='Fj9et'><b id='Fj9et'><form id='Fj9et'><ins id='Fj9et'></ins><ul id='Fj9et'></ul><sub id='Fj9et'></sub></form><legend id='Fj9et'></legend><bdo id='Fj9et'><pre id='Fj9et'><center id='Fj9et'></center></pre></bdo></b><th id='Fj9et'></th></span></q></dt></tr></i><div id='Fj9et'><tfoot id='Fj9et'></tfoot><dl id='Fj9et'><fieldset id='Fj9et'></fieldset></dl></div>
    2. @Nullable 和 SonarQube '有条件执行的块应该可以访问' 警告

      时间:2024-05-09
      • <i id='Gxz6r'><tr id='Gxz6r'><dt id='Gxz6r'><q id='Gxz6r'><span id='Gxz6r'><b id='Gxz6r'><form id='Gxz6r'><ins id='Gxz6r'></ins><ul id='Gxz6r'></ul><sub id='Gxz6r'></sub></form><legend id='Gxz6r'></legend><bdo id='Gxz6r'><pre id='Gxz6r'><center id='Gxz6r'></center></pre></bdo></b><th id='Gxz6r'></th></span></q></dt></tr></i><div id='Gxz6r'><tfoot id='Gxz6r'></tfoot><dl id='Gxz6r'><fieldset id='Gxz6r'></fieldset></dl></div>
        <tfoot id='Gxz6r'></tfoot>

          <tbody id='Gxz6r'></tbody>

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

            <bdo id='Gxz6r'></bdo><ul id='Gxz6r'></ul>
            <legend id='Gxz6r'><style id='Gxz6r'><dir id='Gxz6r'><q id='Gxz6r'></q></dir></style></legend>
                本文介绍了@Nullable 和 SonarQube '有条件执行的块应该可以访问' 警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                包有以下 package-info.java:

                Package has following package-info.java:

                @ParametersAreNonnullByDefault
                package foo;
                import javax.annotation.ParametersAreNonnullByDefault;
                

                类有如下方法:

                private static String toIsoString(@Nullable Instant dateTime) {
                  return dateTime == null ? null : dateTime.toString();
                }
                

                SonarQube(版本 6.2,SonarJava 4.14.0.11784)给出以下警告(squid:S2583):

                On which SonarQube (Version 6.2, SonarJava 4.14.0.11784) gives the following warning (squid:S2583):

                如何让 SonarQube 相信代码实际上是正确的?

                How can I convince SonarQube that the code is actually correct?

                有趣的是,Idea 中的 SonarLint 插件 (3.0.0.2041) 不会生成相同的警告.

                Interestingly, SonarLint plugin (3.0.0.2041) in Idea doesn't generate the same warning.

                推荐答案

                显然,这个问题是由于我们使用 sonar-scanner 没有指定 sonar.java.libraries.由于它是多模块 maven 项目,我们不清楚如何正确指定 sonar.java.libraries.

                Apparently, this problem was caused by us using sonar-scanner without specifying sonar.java.libraries. Since it's multimodule maven project it wasn't clear to us how to specify sonar.java.libraries correctly.

                来自 SonarSource 的 Nicolas Peru 建议我们应该使用 sonar maven 插件,而不是 sonar-scanner,因为该插件可以访问项目的构建类路径.确实为我们解决了这个问题.

                Nicolas Peru, from SonarSource, suggested that we should use sonar maven plugin, instead of sonar-scanner, as the plugin has access to build classpath of the project. Indeed that solved this problem for us.

                这篇关于@Nullable 和 SonarQube '有条件执行的块应该可以访问' 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 Eclipse 中将项目关联到 Sonar 下一篇:SONAR 抱怨改变条件,使其并不总是评估为“假".

                相关文章

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

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

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