Skip to content

Commit

Permalink
HSEARCH-4712 Add checkstyle rules to detect sync blocks to be replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta authored and yrodiere committed Jan 2, 2023
1 parent d8b368c commit c257518
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build/config/src/main/resources/checkstyle.xml
Expand Up @@ -94,6 +94,13 @@
<property name="ignoreComments" value="true" />
</module>

<!-- Do not use sync blocks on objects -->
<module name="RegexpSinglelineJava">
<property name="format" value="synchronized\s*\(\s*(?!this\b)\w+" />
<property name="message" value="Do not use `synchronized (someObject)` blocks. Instead use the `java.util.concurrent.locks.Lock`s. See HSEARCH-4712." />
<property name="ignoreComments" value="true" />
</module>

<!-- Checks for imports -->
<module name="AvoidStarImport" />
<module name="RedundantImport" />
Expand Down

0 comments on commit c257518

Please sign in to comment.