1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

Add ParenPad and NoWhitespaceAfter checkstyle rules

This commit is contained in:
Florian Schmaus 2016-11-29 12:01:41 +01:00
parent 9d0d8088f4
commit 9165e818d9
17 changed files with 76 additions and 60 deletions

View file

@ -248,11 +248,13 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
*/
private final ExecutorService cachedExecutorService = Executors.newCachedThreadPool(
// @formatter:off
// CHECKSTYLE:OFF
new SmackExecutorThreadFactory( // threadFactory
this,
"Cached Executor"
)
// @formatter:on
// CHECKSTYLE:ON
);
/**

View file

@ -149,7 +149,7 @@ public final class SmackConfiguration {
* @param mech the SASL mechanism to be added
*/
public static void addSaslMech(String mech) {
if(! defaultMechs.contains(mech) ) {
if(!defaultMechs.contains(mech)) {
defaultMechs.add(mech);
}
}

View file

@ -39,7 +39,7 @@ public class ProxyInfo
private ProxyType proxyType;
private final ProxySocketConnection proxySocketConnection;
public ProxyInfo( ProxyType pType, String pHost, int pPort, String pUser,
public ProxyInfo(ProxyType pType, String pHost, int pPort, String pUser,
String pPass)
{
this.proxyType = pType;

View file

@ -983,9 +983,9 @@ public class PacketParserUtils {
private static String getLanguageAttribute(XmlPullParser parser) {
// CHECKSTYLE:OFF
for (int i = 0; i < parser.getAttributeCount(); i++) {
// CHECKSTYLE:ON
String attributeName = parser.getAttributeName(i);
if ( "xml:lang".equals(attributeName) ||
// CHECKSTYLE:ON
("lang".equals(attributeName) &&
"xml".equals(parser.getAttributePrefix(i)))) {
// CHECKSTYLE:OFF

View file

@ -249,7 +249,7 @@ public class StringUtils {
*/
public static String encodeHex(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for ( int j = 0; j < bytes.length; j++ ) {
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = HEX_CHARS[v >>> 4];
hexChars[j * 2 + 1] = HEX_CHARS[v & 0x0F];