<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Disqus - Latest Comments for .k</title><link>http://disqus.com/people/053cc79d13645f3e2346b00029d079bf/</link><description></description><language>en</language><lastBuildDate>Tue, 17 Jul 2007 19:33:47 -0000</lastBuildDate><item><title>Re: Evil Behavior with Unchecked Checked Exceptions</title><link>http://thinkinginsideabiggerbox.disqus.com/evil_behavior_with_unchecked_checked_exceptions/#comment-1798431</link><description>It can actually be a lot easier than Anders' example. See this &lt;a href="http://weblogs.java.net/blog/crazybob/archive/2004/09/dont_try_this_a.html" rel="nofollow"&gt;http://weblogs.java.net/blog/crazybob/archive/2...&lt;/a&gt;&lt;br&gt;for even more clever implementations. :-)&lt;br&gt;&lt;br&gt;I propose a utility-class with something like this, and we're good to go: &lt;br&gt;&lt;br&gt;  public static void throwUnchecked(final Throwable pException) {&lt;br&gt;    // Type parameter to Thrower is erased at compile-time&lt;br&gt;    new Thrower().sneakyThrow(pException);&lt;br&gt;  }&lt;br&gt;&lt;br&gt;  private static class Thrower {&lt;br&gt;    private void sneakyThrow(Throwable pException) throws T {&lt;br&gt;      throw (T) pException; // Unchecked cast&lt;br&gt;    }&lt;br&gt;  }&lt;br&gt;&lt;br&gt;I'm starting to think this might be useful.. Or... Maybe I'm just tired.. :-P&lt;br&gt;&lt;br&gt;&lt;br&gt;.k</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">.k</dc:creator><pubDate>Tue, 17 Jul 2007 19:33:47 -0000</pubDate></item></channel></rss>