mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Add checkstyle rule for 'synchronized' on Manager.getInstanceFor()
This commit is contained in:
parent
488055948d
commit
11775ed6b0
2 changed files with 15 additions and 0 deletions
|
@ -6,6 +6,11 @@
|
|||
<module name="SuppressionFilter">
|
||||
<property name="file" value="config/suppressions.xml"/>
|
||||
</module>
|
||||
<module name="SuppressWithPlainTextCommentFilter">
|
||||
<property name="offCommentFormat" value="CHECKSTYLE\:OFF\:(\w+)"/>
|
||||
<property name="onCommentFormat" value="CHECKSTYLE\:ON\:(\w+)"/>
|
||||
<property name="checkFormat" value="$1"/>
|
||||
</module>
|
||||
<module name="Header">
|
||||
<property name="headerFile" value="config/${checkstyleLicenseHeader}.txt"/>
|
||||
<property name="ignoreLines" value="3"/>
|
||||
|
@ -61,6 +66,14 @@
|
|||
<property name="format" value="^\s*//[^\s]"/>
|
||||
<property name="message" value="Comment start ('//') followed by non-space character. You would not continue after a punctuation without a space, would you?"/>
|
||||
</module>
|
||||
<!-- Check for synchronized keyword on Manager's static
|
||||
getInstanceFor() method. Note that if XMPPConnection is every
|
||||
replaced with something else, then we need to change it here
|
||||
too. -->
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="^\s*public(?!.*synchronized).*getInstanceFor\(XMPPConnection.*$"/>
|
||||
<property name="message" value="getInstanceFor() should be synchronized"/>
|
||||
</module>
|
||||
<module name="JavadocPackage"/>
|
||||
<module name="TreeWalker">
|
||||
<module name="SuppressionCommentFilter"/>
|
||||
|
|
|
@ -178,7 +178,9 @@ public final class MamManager extends Manager {
|
|||
* @param connection the XMPP connection to get the archive for.
|
||||
* @return the instance of MamManager.
|
||||
*/
|
||||
// CHECKSTYLE:OFF:RegexpSingleline
|
||||
public static MamManager getInstanceFor(XMPPConnection connection) {
|
||||
// CHECKSTYLE:ON:RegexpSingleline
|
||||
return getInstanceFor(connection, (Jid) null);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue