Community
Participate
Working Groups
Hi I often seem to add exceptions to the throws clauses of methods in my classes and then forget to remove them. It would be nice if, in the case of private and of static methods, the compiler could report a warning for exceptions that cannot possibly be thrown by the methods. For private methods and static methods, overriding is impossible, so no intr- class analysis is necessary - it should be determinable from the method body. Thanks
This was added a while back in 3.0 stream. It is optional and controlled by: Preferences>Java>Compiler>Unused Code>Unnecessary declaration of thrown exception