dongjoon-hyun commented on a change in pull request #25335: [SPARK-28601][CORE]
Use StandardCharsets.UTF_8 instead of "UTF-8" string representation
URL: https://github.com/apache/spark/pull/25335#discussion_r310186763
##########
File path:
core/src/main/scala/org/apache/spark/executor/ProcfsMetricsGetter.scala
##########
@@ -171,7 +172,8 @@ private[spark] class ProcfsMetricsGetter(procfsDir: String
= "/proc/") extends L
val pidDir = new File(procfsDir, pid.toString)
def openReader(): BufferedReader = {
val f = new File(new File(procfsDir, pid.toString), procfsStatFile)
- new BufferedReader(new InputStreamReader(new FileInputStream(f),
Charset.forName("UTF-8")))
+ new BufferedReader(new InputStreamReader(new FileInputStream(f),
+ StandardCharsets.UTF_8.name()))
Review comment:
Ditto. Let's import `java.nio.charset.StandardCharsets.UTF_8` instead of
splitting this into two lines?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]