From cfe934e2d057072e29cabb0a1c9db93a85ac5d63 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sat, 10 Jul 2021 10:25:48 -0400 Subject: [PATCH] Better private method name. --- .../lang3/exception/ExceptionUtils.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java index 0041341c3..1913a3bf6 100644 --- a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java +++ b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java @@ -68,6 +68,17 @@ public class ExceptionUtils { */ static final String WRAPPED_MARKER = " [wrapped] "; + /** + * Claims a Throwable is another Exception type using type erasure. This + * hides a checked exception from the Java compiler, allowing a checked + * exception to be thrown without having the exception in the method's throw + * clause. + */ + @SuppressWarnings("unchecked") + private static R eraseType(final Throwable throwable) throws T { + throw (T) throwable; + } + /** * Introspects the {@code Throwable} to obtain the cause. * @@ -753,7 +764,7 @@ public class ExceptionUtils { */ public static R rethrow(final Throwable throwable) { // claim that the typeErasure invocation throws a RuntimeException - return ExceptionUtils.typeErasure(throwable); + return ExceptionUtils.eraseType(throwable); } /** @@ -885,17 +896,6 @@ public class ExceptionUtils { return throwableOf(throwable, type, fromIndex, true); } - /** - * Claims a Throwable is another Exception type using type erasure. This - * hides a checked exception from the Java compiler, allowing a checked - * exception to be thrown without having the exception in the method's throw - * clause. - */ - @SuppressWarnings("unchecked") - private static R typeErasure(final Throwable throwable) throws T { - throw (T) throwable; - } - /** * Throws a checked exception without adding the exception to the throws * clause of the calling method. For checked exceptions, this method throws