<legend id='UFFYZ'><style id='UFFYZ'><dir id='UFFYZ'><q id='UFFYZ'></q></dir></style></legend>
      • <bdo id='UFFYZ'></bdo><ul id='UFFYZ'></ul>
      1. <small id='UFFYZ'></small><noframes id='UFFYZ'>

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

        如何抑制特定函数的 Java 编译器警告

        时间:2023-10-15
        1. <legend id='53gGC'><style id='53gGC'><dir id='53gGC'><q id='53gGC'></q></dir></style></legend>
            • <bdo id='53gGC'></bdo><ul id='53gGC'></ul>
            • <i id='53gGC'><tr id='53gGC'><dt id='53gGC'><q id='53gGC'><span id='53gGC'><b id='53gGC'><form id='53gGC'><ins id='53gGC'></ins><ul id='53gGC'></ul><sub id='53gGC'></sub></form><legend id='53gGC'></legend><bdo id='53gGC'><pre id='53gGC'><center id='53gGC'></center></pre></bdo></b><th id='53gGC'></th></span></q></dt></tr></i><div id='53gGC'><tfoot id='53gGC'></tfoot><dl id='53gGC'><fieldset id='53gGC'></fieldset></dl></div>

                <small id='53gGC'></small><noframes id='53gGC'>

                    <tbody id='53gGC'></tbody>
                  <tfoot id='53gGC'></tfoot>
                  本文介绍了如何抑制特定函数的 Java 编译器警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  We are always taught to make sure we use a break in switch statements to avoid fall-through.

                  The Java compiler warns about these situations to help us not make trivial (but drastic) errors.

                  I have, however, used case fall-through as a feature (we don't have to get into it here, but it provides a very elegant solution).

                  However the compiler spits out massive amounts of warnings that may obscure warnings that I need to know about. I know how I can change the compiler to ignore ALL fall-through warnings, but I would like to implement this on a method-by-method basis to avoid missing a place where I did not intend for fall-through to happen.

                  Any Ideas?

                  解决方案

                  If you really, really must do this, and you are sure you are not making a mistake, check out the @SuppressWarnings annotation. I suppose in your case you need

                  @SuppressWarnings("fallthrough")
                  

                  这篇关于如何抑制特定函数的 Java 编译器警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何为 javac 设置 PATH 变量,以便手动编译我的 .java 作品? 下一篇:在 Java 类中实现的具有相同方法签名的两个接口

                  相关文章

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

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

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