title: Suppress-catch or throw exceptions which can never occur?
body: <p>Say I have the following line in a method:</p>
  
  <pre><code> String encodedString = URLEncoder.encode(foo, "utf-8");
  </code></pre>
  
  <p>this method throws an <code>UnsupportedEncodingException</code>. Which is better:</p>
  
  <pre><code>/** @throws UnsupportedEncodingException umm...never
   */
  public void myMethod() throws UnsupportedEncodingException {
     ...
     String encodedString = URLEncoder.encode(foo, "utf-8");
     ...
  }
  </code></pre>
  
  <p>(forcing the caller to catch this himself) Or:</p>
  
  <pre><code>public void myMethod() {
     try {
       ...
       String encodedString = URLEncoder.encode(foo, "utf-8");
       ...
     catch(UnsupportedEncodingException e) {
        Logger.log("cosmic ray detected!");
     }
  
  }
  </code></pre>
  
  <p>Or is there a more elegant way of handling exceptions which can't really ever occur?</p>