SteNicholas opened a new pull request, #3367:
URL: https://github.com/apache/celeborn/pull/3367

   ### What changes were proposed in this pull request?
   
   Clean up deprecated Guava API usage.
   
   ### Why are the changes needed?
   
   There are deprecated Guava API usage, including:
   
   1. Made modifications to Throwables.propagate with reference to 
https://github.com/google/guava/wiki/Why-we-deprecated-Throwables.propagate
   
   - For cases where it is known to be a checked exception, including 
`IOException`, `GeneralSecurityException`, `SaslException`, and 
`RocksDBException`, none of which are subclasses of RuntimeException or Error, 
directly replaced Throwables.propagate(e) with `throw new RuntimeException(e);`.
   
   - For cases where it cannot be determined whether it is a checked exception 
or an unchecked exception or Error, use
   
   ```
   throwIfUnchecked(e);
   throw new RuntimeException(e);
   ```
   
   to replace `Throwables.propagate(e)`.
   
   
https://github.com/google/guava/blob/0c33dd12b193402cdf6962d43d69743521aa2f76/guava/src/com/google/common/base/Throwables.java#L199-L235
   
   ```
     /**
      * ...
      * @deprecated To preserve behavior, use {@code throw e} or {@code throw 
new RuntimeException(e)}
      *     directly, or use a combination of {@link #throwIfUnchecked} and 
{@code throw new
      *     RuntimeException(e)}. But consider whether users would be better 
off if your API threw a
      *     different type of exception. For background on the deprecation, 
read <a
      *     href="https://goo.gl/Ivn2kc";>Why we deprecated {@code 
Throwables.propagate}</a>.
      */
     @CanIgnoreReturnValue
     @J2ktIncompatible
     @GwtIncompatible
     @Deprecated
     public static RuntimeException propagate(Throwable throwable) {
       throwIfUnchecked(throwable);
       throw new RuntimeException(throwable);
     }
   ```
   
   Backport https://github.com/apache/spark/pull/48248
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   CI.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to