spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject spark git commit: [SPARK-13203] Add scalastyle rule banning use of mutable.SynchronizedBuffer
Date Wed, 10 Feb 2016 10:58:44 GMT
Repository: spark
Updated Branches:
  refs/heads/master 2ba9b6a2d -> e834e421d


[SPARK-13203] Add scalastyle rule banning use of mutable.SynchronizedBuffer

andrewor14
Please take a look

Author: tedyu <yuzhihong@gmail.com>

Closes #11134 from tedyu/master.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e834e421
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e834e421
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e834e421

Branch: refs/heads/master
Commit: e834e421dec30be8dade21287165d5eb95411c73
Parents: 2ba9b6a
Author: tedyu <yuzhihong@gmail.com>
Authored: Wed Feb 10 10:58:41 2016 +0000
Committer: Sean Owen <sowen@cloudera.com>
Committed: Wed Feb 10 10:58:41 2016 +0000

----------------------------------------------------------------------
 scalastyle-config.xml | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e834e421/scalastyle-config.xml
----------------------------------------------------------------------
diff --git a/scalastyle-config.xml b/scalastyle-config.xml
index 967a482..64619d2 100644
--- a/scalastyle-config.xml
+++ b/scalastyle-config.xml
@@ -169,6 +169,18 @@ This file is divided into 3 sections:
     ]]></customMessage>
   </check>
 
+  <check customId="mutablesynchronizedbuffer" level="error" class="org.scalastyle.file.RegexChecker"
enabled="true">
+    <parameters><parameter name="regex">mutable\.SynchronizedBuffer</parameter></parameters>
+    <customMessage><![CDATA[
+      Are you sure that you want to use mutable.SynchronizedBuffer? In most cases, you should
use
+      java.util.concurrent.ConcurrentLinkedQueue instead.
+      If you must use mutable.SynchronizedBuffer, wrap the code block with
+      // scalastyle:off mutablesynchronizedbuffer
+      mutable.SynchronizedBuffer[...]
+      // scalastyle:on mutablesynchronizedbuffer
+    ]]></customMessage>
+  </check>
+
   <check customId="classforname" level="error" class="org.scalastyle.file.RegexChecker"
enabled="true">
     <parameters><parameter name="regex">Class\.forName</parameter></parameters>
     <customMessage><![CDATA[


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message