class Bouncy extends Throwable {
}
// Error: the generic class Bouncy may not subclass java.lang.Throwable
Why doesn\'t Java
Java Language Specification 8.1.2 Generic Classes and Type Parameters:
This restriction is needed since the catch mechanism of the Java virtual machine works only with non-generic classes.
Personally, I think it's because we can't get any benefits of generics inside a catch clause. We can't write catch (Bouncy due to type erasure, but if we write catch (Bouncy ex), it would be useless to make it generic.