That said, right in Java API we find absolutely unsafe methods masquerading as safe. Like ArrayList.add(Object), which declares no checked exceptions but documents IndexOutOfBoundsException. It may also throw NegativeSizeException, or NullPointerException. Or if used wrong, ArrayStoreException. This leads to a lot of unknowingly broken code and fails spectacularly in production. To say nothing of arrays/Strings, or dates and time, or Collections. What should be basic stuff!
All these broken "safe" methods do make it hard to write good safe code. I think this can only be because they are badly designed. Half of this could be cleared right up with some "throws Exception". At least then the authors and users of this code would think harder about failure in their designs, and the computer would be able to help for the rest.
throws Exceptioneverywhere then maybe they would have noticed. I would much rather list.add() be designed to be safe and never throw, than just not handle errors and pretend like they'll never happen.
Foo extends Baris a what doesn't exist in real world