Description
Java assumes that all exceptions thrown by a function are either declared in the function signature, or extend RuntimeException. As such, the compiler will prevent users from catching a checked exception which is not declared in the function signature.
The Java API defines a parse function which does not declare any exceptions. However, this function can throw a NotYetImplementedException (and possibly other exceptions).
If a Java user attempts to catch this exception, the compiler will complain because NotYetImplementedException is a checked exception, so Java believes it cannot be thrown.
I suspect that this issue occurs in other places in out Java API.
The simplest solution is to make all Scala exceptions RuntimeExceptions. Since Scala does not have checked exceptions, this is no loss to the Scala users, and will allow Java users to treat them as normal unchecked exceptions.
The more correct solution is to go throw the java API and add throws annotations, such as:
@throws(classOf[NotYetImplementedException])
In the meantime, users can work around this by catching Exception, and doing an explicit instanceOf test themselves.