garydgregory commented on a change in pull request #450: Add and use 
IllegalArgumentExceptions
URL: https://github.com/apache/commons-lang/pull/450#discussion_r321344141
 
 

 ##########
 File path: src/main/java/org/apache/commons/lang3/Functions.java
 ##########
 @@ -536,23 +545,22 @@ public static void tryWithResources(FailableRunnable<? 
extends Throwable> pActio
     }
 
     /**
-     * Rethrow a {@link Throwable} as an unchecked exception.
+     * Rethrows a {@link Throwable} as an unchecked exception.
      * @param pThrowable The throwable to rethrow
      * @return Never returns anything, this method never terminates normally
      */
     public static RuntimeException rethrow(Throwable pThrowable) {
         if (pThrowable == null) {
             throw new NullPointerException("The Throwable must not be null.");
+        }
+        if (pThrowable instanceof RuntimeException) {
 
 Review comment:
   Will commit to master instead. A PR for this is over the top IMO. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to