<pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
    <pre id="vvttv"></pre>

      <p id="vvttv"></p>

          <p id="vvttv"></p>

                <p id="vvttv"></p>

                <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                  <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                    <p id="vvttv"></p>

                    Dead Code: Unused Field

                    ABSTRACT

                    從不使用這個字段。

                    EXPLANATION

                    這個字段從未被訪問過,或者僅通過 dead code 進行調用。Dead code 是指從未以公共方法直接或間接執行的代碼。雖然某一字段可能已經過時,不太被人們使用了,但 unused field 仍有可能指出 bug 的所在。

                    例 1: 在以下的類中,并沒有使用到 glue 字段。但是該類的作者無意間對該字段名進行了引用,將其轉變成了字符串常量。


                    public class Dead {

                    String glue;

                    public String getGlue() {
                    return "glue";
                    }

                    }


                    例 2: 在下面這個類中使用了 glue 字段,但是并不會調用使用這個字段的方法。


                    public class Dead {

                    String glue;

                    private String getGlue() {
                    return glue;
                    }

                    }

                    REFERENCES

                    [1] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3050 CAT II

                    [2] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3050 CAT II

                    [3] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 561


                    Copyright 2013 Fortify Software - All rights reserved.
                    (Generated from version 2013.1.1.0008 of the Fortify Secure Coding Rulepacks)
                    desc.structural.java.dead_code_unused_field

                      <pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
                      <pre id="vvttv"></pre>

                        <p id="vvttv"></p>

                            <p id="vvttv"></p>

                                  <p id="vvttv"></p>

                                  <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                                    <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                                      <p id="vvttv"></p>

                                      这里只有精品视频