Skip to content

Commit 38240a7

Browse files
committedNov 25, 2019
[SPARK-30030][INFRA] Use RegexChecker instead of TokenChecker to check org.apache.commons.lang.
### What changes were proposed in this pull request? This PR replace `TokenChecker` with `RegexChecker` in `scalastyle` and fixes the missed instances. ### Why are the changes needed? This will remove the old `comons-lang2` dependency from `core` module **BEFORE** ``` $ dev/scalastyle Scalastyle checks failed at following occurrences: [error] /Users/dongjoon/PRS/SPARK-SerializationUtils/core/src/test/scala/org/apache/spark/util/PropertiesCloneBenchmark.scala:23:7: Use Commons Lang 3 classes (package org.apache.commons.lang3.*) instead [error] of Commons Lang 2 (package org.apache.commons.lang.*) [error] Total time: 23 s, completed Nov 25, 2019 11:47:44 AM ``` **AFTER** ``` $ dev/scalastyle Scalastyle checks passed. ``` ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Pass the GitHub Action linter. Closes apache#26666 from dongjoon-hyun/SPARK-29081-2. Authored-by: Dongjoon Hyun <dhyun@apple.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
1 parent 1466863 commit 38240a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎core/src/test/scala/org/apache/spark/util/PropertiesCloneBenchmark.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import java.util.Properties
2020

2121
import scala.util.Random
2222

23-
import org.apache.commons.lang.SerializationUtils
23+
import org.apache.commons.lang3.SerializationUtils
2424

2525
import org.apache.spark.benchmark.{Benchmark, BenchmarkBase}
2626

‎scalastyle-config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ This file is divided into 3 sections:
258258
scala.collection.JavaConverters._ and use .asScala / .asJava methods</customMessage>
259259
</check>
260260

261-
<check customId="commonslang2" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true">
261+
<check customId="commonslang2" level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
262262
<parameters><parameter name="regex">org\.apache\.commons\.lang\.</parameter></parameters>
263263
<customMessage>Use Commons Lang 3 classes (package org.apache.commons.lang3.*) instead
264264
of Commons Lang 2 (package org.apache.commons.lang.*)</customMessage>

0 commit comments

Comments
 (0)
Please sign in to comment.