Skip to content

Commit d56f430

Browse files
committed
CatalogUtils: explicitly catch checked exceptions and convert them to RuntimeException.
No functional changes.
1 parent 6fa7732 commit d56f430

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/java/ru/mystamps/web/util/CatalogUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package ru.mystamps.web.util;
1919

20+
import java.lang.reflect.InvocationTargetException;
2021
import java.util.ArrayList;
2122
import java.util.Collections;
2223
import java.util.Comparator;
@@ -126,12 +127,11 @@ public static <T extends StampsCatalog> Set<T> fromString(
126127
result.add(
127128
ConstructorUtils.invokeConstructor(elementClass, number)
128129
);
129-
130-
} catch (RuntimeException ex) { // NOPMD
131-
throw ex;
132-
133-
} catch (Exception ex) { // NOPMD
134-
throw new RuntimeException(ex); // NOPMD
130+
} catch (NoSuchMethodException |
131+
IllegalAccessException |
132+
InvocationTargetException |
133+
InstantiationException ex) {
134+
throw new RuntimeException(ex); // NOPMD: AvoidThrowingRawExceptionTypes
135135
}
136136
}
137137

0 commit comments

Comments
 (0)