...
Code Block | ||
---|---|---|
| ||
interface Thr<EXC extends Exception> { void fn() throws EXC; } public class UndeclaredGen { static void undeclaredThrow() throws RuntimeException { @SuppressWarnings("unchecked") // Suppresses warnings Thr<RuntimeException> thr = (Thr<RuntimeException>)(Thr) new Thr<IOException>() { public void fn() throws IOException { throw new IOException(); } }; thr.fn(); } public static void main(String[] args) { undeclaredThrow(); } } |
Noncompliant Code Example (Thread.stop(
...
Throwable)
...
)
Wiki Markup |
---|
According to the Java API \[[API 2006|AA. Bibliography#API 06]\], class {{Thread}}: |
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1510ea2213f43b4c-761ef22e-433749f2-9f2ebd2a-dbdbc70370c488bd5d1edb94"><ac:plain-text-body><![CDATA[ | [[Bloch 2008 | AA. Bibliography#Bloch 08]] | Item 2. Consider a builder when faced with many constructor parameters | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0ff88a0e0d4e5d0d-f8c37685-429e4f18-9ccbad81-7a69bb077ed49e17e8de82c5"><ac:plain-text-body><![CDATA[ | [[Goetz 2004b | AA. Bibliography#Goetz 04b]] |
| ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="964567f052afbab8-733af371-444c40c0-b3d5be23-ab2fabc471f089eb7fef7ad4"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS 05]] | Chapter 11, Exceptions | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="82c61b7be9bf9ba5-d2249efe-40a14968-a5899ce9-e5441172b19f0eca1d7c3417"><ac:plain-text-body><![CDATA[ | [[Roubtsov 2003 | AA. Bibliography#Roubtsov 03]] |
| ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="02e93e5b8c3a2c9b-d1bef2d3-4a134b50-9d4786b7-5a0ed703c0aa5a750e3a9160"><ac:plain-text-body><![CDATA[ | [[Schwarz 2004 | AA. Bibliography#Schwarz 04]] |
| ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="460a3a46581995bd-55e5a247-43054306-b3549828-64e0010334c3168c78a9c504"><ac:plain-text-body><![CDATA[ | [[Venners 2003 | AA. Bibliography#Venners 03]] | Scalability of Checked Exceptions | ]]></ac:plain-text-body></ac:structured-macro> |
...