I was merging my source code with that of a colleague and I saw he had added an exception to be thrown in the declaration of a method; however, I knew, that exception would never be really thrown from that method.
I wonder why the compiler did not warn me about a "non-thrown exception declared" (or something like that). I realize that you can declare a method throwing N exceptions, even if none of those exceptions is thrown by the code in the method.
Why is that?
public void foo() throws IOException, IntrospectionException, BadStringOperationException, ... {
//do nothing
}