It kind of surprises me a bit that it compiles, but after a bit of testing I found out why.

A finally block will always get executed*. Therefore, the "return -1" will overrule the exception that is thrown. Remove that return statement and the compiler complains that Exception must be caught or thrown.

* provided there is no System.exit, JVM crash or other unrecoverable error such as the PC dying.