title: How does scala generated byte code drops the checked exception?
body: <p>If it possible to write byte code for a method that is supposed to throw a checked exception?</p>
  
  <p>For instance the following Java class doesn't compile unless the method declares it throws the checked exception: </p>
  
  <pre><code>public class CheckedExceptionJava {
    public Class&lt;?&gt; testChecked(String s) throws ClassNotFoundException {
      return Class.forName(s);
    }
  }
  </code></pre>
  
  <p>While the following Scala equivalent does ( because Scala doesn't have checked exceptions ) :</p>
  
  <pre><code>class CheckedException { 
      def testChecked( s : String )  = Class.forName( s ) 
  }
  </code></pre>
  
  <p>Even if the bytecode generated are almost identical:</p>
  
  <pre><code>Compiled from "CheckedExceptionJava.java"
  public class CheckedExceptionJava extends java.lang.Object{
  public CheckedExceptionJava();
    Code:
     0:   aload_0
     1:   invokespecial   #1; //Method java/lang/Object."&lt;init&gt;":()V
     4:   return
  
  public java.lang.Class testChecked(java.lang.String)   throws java.lang.ClassNotFoundException;
    Code:
     0:   aload_1
     1:   invokestatic    #2; //Method java/lang/Class.forName:(Ljava/lang/String;)Ljava/lang/Class;
     4:   areturn
  
  }
  
  Compiled from "CheckedException.scala"
  public class CheckedException extends java.lang.Object implements scala.ScalaObject{
  public CheckedException();
    Code:
     0:   aload_0
     1:   invokespecial   #24; //Method java/lang/Object."&lt;init&gt;":()V
     4:   return
  
  public java.lang.Class testChecked(java.lang.String);
    Code:
     0:   aload_1
     1:   invokestatic    #11; //Method java/lang/Class.forName:(Ljava/lang/String;)Ljava/lang/Class;
     4:   areturn
  
  }
  </code></pre>
  
  <p>Question: Is it possible ( and how )  to generate bytecode for that doesn't mark it throws a checked exception even if the code inside that method doesn't handle it?</p>