I have the following code:
public static void main(String[] args)
{
willItThrowException();
}
private static void willItThrowException() throws RuntimeException
{
throw new RuntimeException();
}
Is there any configuration of eclipse that can show a warning/error on uncaught runtime exception that is declared in method declaration but not catched in line of willItThrowException();
?
Not that I'm aware of, and I can't find one. Catching runtime exceptions is not always a good choice though. And you will get tons of warnings about catching
IllegalArgumentException
andNullPointerException
. Runtime exceptions are usually meant not to be recoverable from.