Skip to content

Commit

Permalink
objectionary#3140: No generic
Browse files Browse the repository at this point in the history
  • Loading branch information
levBagryansky committed May 12, 2024
1 parent 0f374a0 commit d9513a5
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,12 @@ void printsCauseWhenFailsToBuild(@TempDir final Path temp) throws IOException {
* Get message of exception to be thrown.
* @param exec Something that should throw exception of specified type.
* @param type Subtype of {@link Exception} to be thrown.
* @param <T> Subtype of {@link Exception}.
* @return Message retrieved from exception.
* @checkstyle IllegalCatchCheck (16 lines)
*/
@SuppressWarnings("PMD.AvoidCatchingGenericException")
private static <T extends Exception>
String getExceptionMessage(final Runnable exec, final Class<T> type) {
private static String
getExceptionMessage(final Runnable exec, final Class<? extends Exception> type) {
try {
exec.run();
throw new IllegalStateException("Should have thrown an exception");
Expand Down

0 comments on commit d9513a5

Please sign in to comment.