This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new a59941a8ff53 [SPARK-50678][BUILD] Clean up outdated style check rules 
related to Guava
a59941a8ff53 is described below

commit a59941a8ff5372ccd907922ff24ccb66b2419a94
Author: YangJie <[email protected]>
AuthorDate: Fri Jan 3 08:15:11 2025 -0800

    [SPARK-50678][BUILD] Clean up outdated style check rules related to Guava
    
    ### What changes were proposed in this pull request?
    The version of Guava being used by Spark is 33.3.1 now, so this pr cleans 
up the outdated check rules from `dev/checkstyle.xml` and 
`scalastyle-config.xml`
    -  The current version of Guava no longer has the `Objects.toStringHelper` 
method, so this check rule is no longer needed
    - CVE-2020-8908 has been fixed after version 32.0.0, so the related check 
is no longer needed
    - CVE-2023-2976 has been fixed after version 32.0.0, so the related check 
is no longer needed
    - CVE-2018-10237 has been fixed after version 24.1.1, so the related check 
is no longer needed
    
    ### Why are the changes needed?
    Clean up outdated style check rules related to Guava
    
    ### 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
    
    Closes #49302 from LuciferYang/checkstyle-outdated.
    
    Lead-authored-by: YangJie <[email protected]>
    Co-authored-by: yangjie01 <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 dev/checkstyle.xml    | 22 ----------------------
 scalastyle-config.xml | 27 ---------------------------
 2 files changed, 49 deletions(-)

diff --git a/dev/checkstyle.xml b/dev/checkstyle.xml
index 428502810941..6c50718e27fe 100644
--- a/dev/checkstyle.xml
+++ b/dev/checkstyle.xml
@@ -172,32 +172,10 @@
             <property name="format" value="throw new \w+Error\("/>
             <property name="message" value="Avoid throwing error in 
application code."/>
         </module>
-        <module name="RegexpSinglelineJava">
-            <property name="format" value="Objects\.toStringHelper"/>
-            <property name="message" value="Avoid using Object.toStringHelper. 
Use ToStringBuilder instead." />
-        </module>
         <module name="RegexpSinglelineJava">
             <property name="format" value="new 
(java\.lang\.)?(Byte|Integer|Long|Short)\("/>
             <property name="message" value="Use static factory 'valueOf' or 
'parseXXX' instead of the deprecated constructors." />
         </module>
-        <module name="RegexpSinglelineJava">
-            <property name="format" value="Files\.createTempDir\("/>
-            <property name="message"
-              value="Avoid using com.google.common.io.Files.createTempDir() 
due to CVE-2020-8908.
-                Use org.apache.spark.network.util.JavaUtils.createTempDir() 
instead." />
-        </module>
-        <module name="RegexpSinglelineJava">
-            <property name="format" value="FileBackedOutputStream"/>
-            <property name="message" value="Avoid using FileBackedOutputStream 
due to CVE-2023-2976." />
-        </module>
-        <module name="RegexpSinglelineJava">
-            <property name="format" value="AtomicDoubleArray"/>
-            <property name="message" value="Avoid using AtomicDoubleArray due 
to CVE-2018-10237." />
-        </module>
-        <module name="RegexpSinglelineJava">
-            <property name="format" value="CompoundOrdering"/>
-            <property name="message" value="Avoid using CompoundOrdering due 
to CVE-2018-10237." />
-        </module>
         <module name="RegexpSinglelineJava">
             <property name="format" value="@Test\(expected"/>
             <property name="message" value="Please use the `assertThrows` 
method to test for exceptions." />
diff --git a/scalastyle-config.xml b/scalastyle-config.xml
index 05b3f6a26898..7e64dc9be673 100644
--- a/scalastyle-config.xml
+++ b/scalastyle-config.xml
@@ -460,33 +460,6 @@ This file is divided into 3 sections:
     <parameters><parameter name="ignore">-1,0,1,2,3</parameter></parameters>
   </check>
 
-  <check customId="GuavaToStringHelper" level="error" 
class="org.scalastyle.file.RegexChecker" enabled="true">
-    <parameters><parameter 
name="regex">Objects.toStringHelper</parameter></parameters>
-    <customMessage>Avoid using Object.toStringHelper. Use ToStringBuilder 
instead.</customMessage>
-  </check>
-
-  <check customId="GuavaFilesCreateTempDir" level="error" 
class="org.scalastyle.file.RegexChecker" enabled="true">
-    <parameters><parameter 
name="regex">Files\.createTempDir\(</parameter></parameters>
-    <customMessage>Avoid using com.google.common.io.Files.createTempDir due to 
CVE-2020-8908.
-      Use org.apache.spark.util.Utils.createTempDir instead.
-    </customMessage>
-  </check>
-
-  <check customId="GuavaFileBackedOutputStream" level="error" 
class="org.scalastyle.file.RegexChecker" enabled="true">
-    <parameters><parameter 
name="regex">FileBackedOutputStream</parameter></parameters>
-    <customMessage>Avoid using FileBackedOutputStream due to 
CVE-2023-2976.</customMessage>
-  </check>
-
-  <check customId="GuavaAtomicDoubleArray" level="error" 
class="org.scalastyle.file.RegexChecker" enabled="true">
-    <parameters><parameter 
name="regex">AtomicDoubleArray</parameter></parameters>
-    <customMessage>Avoid using AtomicDoubleArray due to 
CVE-2018-10237.</customMessage>
-  </check>
-
-  <check customId="GuavaCompoundOrdering" level="error" 
class="org.scalastyle.file.RegexChecker" enabled="true">
-    <parameters><parameter 
name="regex">CompoundOrdering</parameter></parameters>
-    <customMessage>Avoid using CompoundOrdering due to 
CVE-2018-10237.</customMessage>
-  </check>
-
   <check customId="byteCountToDisplaySize" level="error" 
class="org.scalastyle.file.RegexChecker" enabled="true">
     <parameters><parameter 
name="regex">byteCountToDisplaySize</parameter></parameters>
     <customMessage>Use Utils.bytesToString instead of byteCountToDisplaySize 
for consistency.</customMessage>


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

Reply via email to