[SPARK-28549][BUILD][CORE][SQL] Use text.StringEscapeUtils instead lang3.StringEscapeUtils

## What changes were proposed in this pull request?

`org.apache.commons.lang3.StringEscapeUtils` was deprecated over two years ago at [LANG-1316](https://issues.apache.org/jira/browse/LANG-1316). There is no bug fixes after that.
```java
/**
 * <p>Escapes and unescapes {code String}s for
 * Java, Java Script, HTML and XML.</p>
 *
 * <p>#ThreadSafe#</p>
 * since 2.0
 * deprecated as of 3.6, use commons-text
 * <a href="https://commons.apache.org/proper/commons-text/javadocs/api-release/org/apache/commons/text/StringEscapeUtils.html">
 * StringEscapeUtils</a> instead
 */
Deprecated
public class StringEscapeUtils {
```

This PR aims to use the latest one from `commons-text` module which has more bug fixes like
[TEXT-100](https://issues.apache.org/jira/browse/TEXT-100), [TEXT-118](https://issues.apache.org/jira/browse/TEXT-118) and [TEXT-120](https://issues.apache.org/jira/browse/TEXT-120) by the following replacement.
```scala
-import org.apache.commons.lang3.StringEscapeUtils
+import org.apache.commons.text.StringEscapeUtils
```

This will add a new dependency to `hadoop-2.7` profile distribution. In `hadoop-3.2` profile, we already have it.
```
+commons-text-1.6.jar
```

## How was this patch tested?

Pass the Jenkins with the existing tests.
- [Hadoop 2.7](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/108281)
- [Hadoop 3.2](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/108282)

Closes #25281 from dongjoon-hyun/SPARK-28549.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
This commit is contained in:
Dongjoon Hyun 2019-07-29 11:45:29 +09:00 committed by HyukjinKwon
parent 6bc5c6a4e7
commit a428f40669
16 changed files with 19 additions and 14 deletions

View file

@ -172,6 +172,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>

View file

@ -23,7 +23,7 @@ import javax.servlet.http.{HttpServletRequest, HttpServletRequestWrapper, HttpSe
import scala.collection.JavaConverters._
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.{SecurityManager, SparkConf}
import org.apache.spark.internal.config.UI._

View file

@ -25,7 +25,7 @@ import scala.collection.JavaConverters._
import scala.collection.mutable.ListBuffer
import scala.xml._
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.JobExecutionStatus
import org.apache.spark.internal.config.SCHEDULER_MODE

View file

@ -23,7 +23,7 @@ import javax.servlet.http.HttpServletRequest
import scala.collection.mutable.{Buffer, ListBuffer}
import scala.xml.{Node, NodeSeq, Unparsed, Utility}
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.JobExecutionStatus
import org.apache.spark.status.AppStatusStore

View file

@ -25,7 +25,7 @@ import javax.servlet.http.HttpServletRequest
import scala.collection.mutable.{HashMap, HashSet}
import scala.xml.{Node, Unparsed}
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.internal.config.UI._
import org.apache.spark.scheduler.TaskLocality

View file

@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest
import scala.collection.JavaConverters._
import scala.xml._
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.status.AppStatusStore
import org.apache.spark.status.api.v1

View file

@ -22,7 +22,7 @@ import java.util.Objects
import scala.collection.mutable
import scala.collection.mutable.{ListBuffer, StringBuilder}
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.internal.Logging
import org.apache.spark.scheduler.StageInfo

View file

@ -44,6 +44,7 @@ commons-logging-1.1.3.jar
commons-math3-3.4.1.jar
commons-net-3.1.jar
commons-pool-1.5.4.jar
commons-text-1.6.jar
compress-lzf-1.0.3.jar
core-1.1.2.jar
curator-client-2.7.1.jar

View file

@ -19,7 +19,7 @@ package org.apache.spark.repl
import java.io._
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.SparkFunSuite
import org.apache.spark.util.Utils

View file

@ -24,7 +24,7 @@ import java.util.{Locale, TimeZone}
import scala.util.control.NonFatal
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.sql.AnalysisException
import org.apache.spark.sql.catalyst.InternalRow

View file

@ -20,7 +20,7 @@ package org.apache.spark.sql.catalyst.expressions
import java.util.Locale
import java.util.regex.{MatchResult, Pattern}
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.sql.catalyst.expressions.codegen._
import org.apache.spark.sql.catalyst.expressions.codegen.Block._

View file

@ -21,7 +21,7 @@ import java.util.concurrent.atomic.AtomicLong
import scala.collection.mutable
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.sql.execution.{SparkPlanInfo, WholeStageCodegenExec}

View file

@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest
import scala.xml.Node
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.internal.Logging
import org.apache.spark.sql.hive.thriftserver.HiveThriftServer2.{ExecutionInfo, ExecutionState, SessionInfo}

View file

@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest
import scala.xml.Node
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.internal.Logging
import org.apache.spark.sql.hive.thriftserver.HiveThriftServer2.{ExecutionInfo, ExecutionState}

View file

@ -21,7 +21,7 @@ import javax.servlet.http.HttpServletRequest
import scala.xml._
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
import org.apache.spark.status.api.v1.{JobData, StageData}
import org.apache.spark.streaming.Time

View file

@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit
import scala.xml.Node
import org.apache.commons.lang3.StringEscapeUtils
import org.apache.commons.text.StringEscapeUtils
private[streaming] object UIUtils {