LuciferYang opened a new pull request, #51960:
URL: https://github.com/apache/spark/pull/51960

   ### What changes were proposed in this pull request?
   
   This pull request replaces `com.google.common.base.Objects` with 
`java.util.Objects`. Specifically, the following changes have been made:
   
   1. Use `java.util.Objects#equals` instead of 
`com.google.common.base.Objects#equal`.
   2. Use `java.util.Objects#hash` instead of 
`com.google.common.base.Objects#hashCode`.
   3. Ban the use of `com.google.common.base.Objects`.
   
   ### Why are the changes needed?
   
   Following the recommendation in `com.google.common.base.Objects`: "
   
   
https://github.com/google/guava/blob/5c71d2a15435399fa62508d807d5cc83506f7496/guava/src/com/google/common/base/Objects.java#L37-L80
   
   ```
     /**
      ...
      *
      * <p><b>Note:</b> this method is now unnecessary and should be treated as 
deprecated; use {@link
      * java.util.Objects#equals} instead.
      */
     public static boolean equal(@CheckForNull Object a, @CheckForNull Object 
b) {
       return a == b || (a != null && a.equals(b));
     }
   
     /**
      ...
      *
      * <p><b>Note:</b> this method is now unnecessary and should be treated as 
deprecated; use {@link
      * java.util.Objects#hash} instead.
      */
     public static int hashCode(@CheckForNull @Nullable Object... objects) {
       return Arrays.hashCode(objects);
     }
   ```
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   - Pass GitHub Actions
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to