Remove declared error that should not occur. #1555

Fixes `ErrorRethrown` inspection violations.

Description:
>Reports try statements which catch java.lang.Error or any subclass and which do not rethrow the error. Statements which catch java.lang.ThreadDeath are not reported by this inspection.
This commit is contained in:
Michal Kordas 2015-08-23 00:41:33 +02:00 committed by Roman Ivanov
parent 13c022282b
commit 80ab48f859
1 changed files with 2 additions and 4 deletions

View File

@ -163,7 +163,7 @@ public class ClassResolver {
safeLoad(name);
return true;
}
catch (final ClassNotFoundException | NoClassDefFoundError ignored) {
catch (final ClassNotFoundException ignored) {
return false;
}
}
@ -174,10 +174,8 @@ public class ClassResolver {
* @param name name of the class to load
* @return the {@code Class} for the specified class
* @throws ClassNotFoundException if an error occurs
* @throws NoClassDefFoundError if an error occurs
*/
public Class<?> safeLoad(String name)
throws ClassNotFoundException, NoClassDefFoundError {
public Class<?> safeLoad(String name) throws ClassNotFoundException {
// The next line will load the class using the specified class
// loader. The magic is having the "false" parameter. This means the
// class will not be initialised. Very, very important.