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

                    Poor Error Handling: Swallowed ThreadDeath

                    ABSTRACT

                    如果重新拋出了 ThreadDeath 錯誤,則出現問題的線程可能實際上并未終止。

                    EXPLANATION

                    如果異步終止了應用程序后需要將其清除,則應僅捕獲 ThreadDeath 錯誤。如果捕獲了 ThreadDeath 錯誤,則將其重新拋出非常重要,因為這樣該線程才真正地終止。拋出 ThreadDeath 的目的是終止線程。如果 ThreadDeath 被抑制,則它可以阻止線程停止并導致意外行為,因為代碼最初拋出 ThreadDeath 的目的是希望停止該線程。

                    例 1:下列代碼捕獲了 ThreadDeath 但未將其重新拋出。


                    try
                    {
                    //some code
                    }
                    catch(ThreadDeath td)
                    {
                    //clean up code
                    }

                    REFERENCES

                    [1] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 691

                    [2] Sun Microsystems, Inc. Java Sun Tutorial

                    [3] Scott Oaks, Henry Wong Java Threads O'Reilly


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

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

                                      这里只有精品视频