aboutsummaryrefslogtreecommitdiff
path: root/scalastyle-config.xml
diff options
context:
space:
mode:
authortedyu <yuzhihong@gmail.com>2015-12-16 19:02:12 -0800
committerAndrew Or <andrew@databricks.com>2015-12-16 19:02:12 -0800
commitf590178d7a06221a93286757c68b23919bee9f03 (patch)
tree94e096dc45037353b602d29f1b2df7d471bcab2d /scalastyle-config.xml
parent38d9795a4fa07086d65ff705ce86648345618736 (diff)
downloadspark-f590178d7a06221a93286757c68b23919bee9f03.tar.gz
spark-f590178d7a06221a93286757c68b23919bee9f03.tar.bz2
spark-f590178d7a06221a93286757c68b23919bee9f03.zip
[SPARK-12365][CORE] Use ShutdownHookManager where Runtime.getRuntime.addShutdownHook() is called
SPARK-9886 fixed ExternalBlockStore.scala This PR fixes the remaining references to Runtime.getRuntime.addShutdownHook() Author: tedyu <yuzhihong@gmail.com> Closes #10325 from ted-yu/master.
Diffstat (limited to 'scalastyle-config.xml')
-rw-r--r--scalastyle-config.xml12
1 files changed, 12 insertions, 0 deletions
diff --git a/scalastyle-config.xml b/scalastyle-config.xml
index dab1ebddc6..6925e18737 100644
--- a/scalastyle-config.xml
+++ b/scalastyle-config.xml
@@ -157,6 +157,18 @@ This file is divided into 3 sections:
]]></customMessage>
</check>
+ <check customId="runtimeaddshutdownhook" level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
+ <parameters><parameter name="regex">Runtime\.getRuntime\.addShutdownHook</parameter></parameters>
+ <customMessage><![CDATA[
+ Are you sure that you want to use Runtime.getRuntime.addShutdownHook? In most cases, you should use
+ ShutdownHookManager.addShutdownHook instead.
+ If you must use Runtime.getRuntime.addShutdownHook, wrap the code block with
+ // scalastyle:off runtimeaddshutdownhook
+ Runtime.getRuntime.addShutdownHook(...)
+ // scalastyle:on runtimeaddshutdownhook
+ ]]></customMessage>
+ </check>
+
<check customId="classforname" level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
<parameters><parameter name="regex">Class\.forName</parameter></parameters>
<customMessage><![CDATA[