...
This noncompliant code example uses the System.runFinalizersOnExit()
method to simulate a garbage collection run. Note that this method is deprecated because of thread-safety issues; see rule MET15 MET02-J. Do not use deprecated or obsolete classes or methods.
Wiki Markup |
---|
According to the Java API \[[API 2006|AA. Bibliography#API 06]\] class {{System}}, {{runFinalizersOnExit()}} method documentation |
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="664568f47a18aa30-e4a44de4-4c4149a1-ba039e87-77ea2c7d754135e87a12b0af"><ac:plain-text-body><![CDATA[ | [[MITRE 2009 | AA. Bibliography#MITRE 09]] | [CWE ID 586 | http://cwe.mitre.org/data/definitions/586.html] "Explicit Call to Finalize()", [CWE ID 583 | http://cwe.mitre.org/data/definitions/583.html] "finalize() Method Declared Public" | ]]></ac:plain-text-body></ac:structured-macro> |
| CWE ID 568 "finalize() Method Without super.finalize()" |
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ba939f3ea30052a1-f8b2c0b6-4fbb4626-a140ad03-36445a7f6a1b9d083083623a"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API 06]] | [finalize() | http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#finalize()] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5fafc6fd10b6d1a1-a2915c6e-4cc34149-82d3be6a-7993640521336f0132dcea9a"><ac:plain-text-body><![CDATA[ | [[Bloch 2008 | AA. Bibliography#Bloch 08]] | Item 7, Avoid finalizers | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="365732f9475fe00b-40ae5b18-4a03486a-8134bc7b-463b3e6a21df7e381d280a98"><ac:plain-text-body><![CDATA[ | [[Boehm 2005 | AA. Bibliography#Boehm 05]] |
| ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b7e0a8ff8e6c1e01-24f739ea-432c414a-a124b384-dfac47cd8c5db552ba770ab4"><ac:plain-text-body><![CDATA[ | [[Coomes 2007 | AA. Bibliography#Coomes 07]] | "Sneaky" Memory Retention | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e4a5040c0a214e87-56870855-456e472b-ad0680e3-5a094cb8de5046e03780a6ac"><ac:plain-text-body><![CDATA[ | [[Darwin 2004 | AA. Bibliography#Darwin 04]] | Section 9.5, The Finalize Method | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="550e1eca00245dfd-c7e70fb0-428f42fb-b5c0b18c-dda0d41b8a753d94099d313e"><ac:plain-text-body><![CDATA[ | [[Flanagan 2005 | AA. Bibliography#Flanagan 05]] | Section 3.3, Destroying and Finalizing Objects | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7b5bf307bed3148d-0cdff096-47bc43cf-b9879d73-ce0e2ffb36a2ef81e9a46ec7"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS 05]] | Section 12.6, Finalization of Class Instances | ]]></ac:plain-text-body></ac:structured-macro> |
...