<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 '有条件执行的块应该可以访问' 警告

      @Nullable and SonarQube #39;Conditionally executed blocks should be reachable#39; warning(@Nullable 和 SonarQube 有条件执行的块应该可以访问 警告)
      • <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 '有条件执行的块应该可以访问' 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

                  <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'>

                        <tbody id='pbPey'></tbody>
                        <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>