Skip to content

Commit

Permalink
[SPARK-13203] Add scalastyle rule banning use of mutable.Synchronized…
Browse files Browse the repository at this point in the history
…Buffer

andrewor14
Please take a look

Author: tedyu <yuzhihong@gmail.com>

Closes #11134 from tedyu/master.
  • Loading branch information
tedyu authored and srowen committed Feb 10, 2016
1 parent 2ba9b6a commit e834e42
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scalastyle-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down

0 comments on commit e834e42

Please sign in to comment.