1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 06:12:05 +01:00

Add comment style checkstyle rule requiring a space

This commit is contained in:
Florian Schmaus 2017-11-20 08:53:19 +01:00
parent 52bd680bb5
commit 9e11b68144
44 changed files with 161 additions and 165 deletions

View file

@ -60,6 +60,10 @@
<property name="format" value="^\s*[\S&amp;&amp;[^\*/]]+\s+$"/> <property name="format" value="^\s*[\S&amp;&amp;[^\*/]]+\s+$"/>
<property name="message" value="Line containing trailing whitespace character(s)"/> <property name="message" value="Line containing trailing whitespace character(s)"/>
</module> </module>
<module name="RegexpSingleline">
<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>
<module name="JavadocPackage"/> <module name="JavadocPackage"/>
<module name="TreeWalker"> <module name="TreeWalker">
<module name="FinalClass"/> <module name="FinalClass"/>

View file

@ -532,7 +532,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
} }
break; break;
case "error": case "error":
//Some bosh error isn't stream error. // Some BOSH error isn't stream error.
if ("urn:ietf:params:xml:ns:xmpp-streams".equals(parser.getNamespace(null))) { if ("urn:ietf:params:xml:ns:xmpp-streams".equals(parser.getNamespace(null))) {
throw new StreamErrorException(PacketParserUtils.parseStreamError(parser)); throw new StreamErrorException(PacketParserUtils.parseStreamError(parser));
} else { } else {

View file

@ -97,7 +97,6 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
| 1 | 1 | | 1 | 1 |
+----+--------+ +----+--------+
*/ */
//in.read(buf, 0, 2);
fill(in, buf, 2); fill(in, buf, 2);
boolean check = false; boolean check = false;
@ -160,7 +159,6 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
`failure' (STATUS value other than X'00') status, it MUST close the `failure' (STATUS value other than X'00') status, it MUST close the
connection. connection.
*/ */
//in.read(buf, 0, 2);
fill(in, buf, 2); fill(in, buf, 2);
if (buf[1] == 0) if (buf[1] == 0)
{ {
@ -260,7 +258,6 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
o BND.PORT server bound port in network octet order o BND.PORT server bound port in network octet order
*/ */
//in.read(buf, 0, 4);
fill(in, buf, 4); fill(in, buf, 4);
if (buf[1] != 0) if (buf[1] != 0)
@ -279,17 +276,13 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
switch (buf[3] & 0xff) switch (buf[3] & 0xff)
{ {
case 1: case 1:
//in.read(buf, 0, 6);
fill(in, buf, 6); fill(in, buf, 6);
break; break;
case 3: case 3:
//in.read(buf, 0, 1);
fill(in, buf, 1); fill(in, buf, 1);
//in.read(buf, 0, buf[0]+2);
fill(in, buf, (buf[0] & 0xff) + 2); fill(in, buf, (buf[0] & 0xff) + 2);
break; break;
case 4: case 4:
//in.read(buf, 0, 18);
fill(in, buf, 18); fill(in, buf, 18);
break; break;
default: default:

View file

@ -840,7 +840,6 @@ public final class ServiceDiscoveryManager extends Manager {
} }
if (info.containsFeature(feature)) { if (info.containsFeature(feature)) {
serviceDiscoInfo.add(info); serviceDiscoInfo.add(info);
//serviceAddresses.add(item.getEntityID().asDomainBareJid());
if (stopOnFirst) { if (stopOnFirst) {
break; break;
} }

View file

@ -303,7 +303,7 @@ public class OutgoingFileTransfer extends FileTransfer {
transferThread = new Thread(new Runnable() { transferThread = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
//Create packet filter // Create packet filter.
try { try {
outputStream = negotiateStream(fileName, fileSize, description); outputStream = negotiateStream(fileName, fileSize, description);
} catch (XMPPErrorException e) { } catch (XMPPErrorException e) {

View file

@ -2408,7 +2408,7 @@ public class MultiUserChat {
listener.nicknameChanged(from, mucUser.getItem().getNick()); listener.nicknameChanged(from, mucUser.getItem().getNick());
} }
} }
//The room has been destroyed // The room has been destroyed.
if (mucUser.getDestroy() != null) { if (mucUser.getDestroy() != null) {
MultiUserChat alternateMUC = multiUserChatManager.getMultiUserChat(mucUser.getDestroy().getJid()); MultiUserChat alternateMUC = multiUserChatManager.getMultiUserChat(mucUser.getDestroy().getJid());
for (UserStatusListener listener : userStatusListeners) { for (UserStatusListener listener : userStatusListeners) {

View file

@ -50,7 +50,7 @@ public class DataFormTest {
@Test @Test
public void test() throws Exception { public void test() throws Exception {
//Build a Form // Build a Form.
DataForm df = new DataForm(DataForm.Type.submit); DataForm df = new DataForm(DataForm.Type.submit);
String instruction = "InstructionTest1"; String instruction = "InstructionTest1";
df.addInstruction(instruction); df.addInstruction(instruction);
@ -77,7 +77,7 @@ public class DataFormTest {
@Test @Test
public void testLayout() throws Exception { public void testLayout() throws Exception {
//Build a Form // Build a Form.
DataForm df = new DataForm(DataForm.Type.submit); DataForm df = new DataForm(DataForm.Type.submit);
String instruction = "InstructionTest1"; String instruction = "InstructionTest1";
df.addInstruction(instruction); df.addInstruction(instruction);
@ -119,7 +119,7 @@ public class DataFormTest {
@Test @Test
public void testValidation() throws Exception { public void testValidation() throws Exception {
//Build a Form // Build a Form.
DataForm df = new DataForm(DataForm.Type.submit); DataForm df = new DataForm(DataForm.Type.submit);
String instruction = "InstructionTest1"; String instruction = "InstructionTest1";
df.addInstruction(instruction); df.addInstruction(instruction);

View file

@ -58,7 +58,7 @@ public class MamIntegrationTest extends AbstractSmackIntegrationTest {
EntityBareJid userOne = conOne.getUser().asEntityBareJid(); EntityBareJid userOne = conOne.getUser().asEntityBareJid();
EntityBareJid userTwo = conTwo.getUser().asEntityBareJid(); EntityBareJid userTwo = conTwo.getUser().asEntityBareJid();
//Make sure MAM is archiving messages // Make sure MAM is archiving messages.
mamManagerConTwo.updateArchivingPreferences(null, null, MamPrefsIQ.DefaultBehavior.always); mamManagerConTwo.updateArchivingPreferences(null, null, MamPrefsIQ.DefaultBehavior.always);
Message message = new Message(userTwo); Message message = new Message(userTwo);

View file

@ -116,7 +116,7 @@ public class JMFInit extends Frame implements Runnable {
throw td; throw td;
} }
catch (Throwable t) { catch (Throwable t) {
//Do nothing // Do nothing.
} }
Class<?> jsauto; Class<?> jsauto;
@ -225,7 +225,7 @@ public class JMFInit extends Frame implements Runnable {
} }
} }
catch (Throwable tt) { catch (Throwable tt) {
//Do nothing // Do nothing.
} }
} }
@ -269,7 +269,7 @@ public class JMFInit extends Frame implements Runnable {
} }
} }
catch (Throwable tt) { catch (Throwable tt) {
//Do nothing // Do nothing.
} }
} }

View file

@ -359,7 +359,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
if (candidate instanceof ICECandidate) { if (candidate instanceof ICECandidate) {
ICECandidate iceCandidate = (ICECandidate) candidate; ICECandidate iceCandidate = (ICECandidate) candidate;
if (iceCandidate.getType().equals(Type.relay)) { if (iceCandidate.getType().equals(Type.relay)) {
//TODO Check if the relay is reacheable // TODO Check if the relay is reacheable.
addValidRemoteCandidate(iceCandidate); addValidRemoteCandidate(iceCandidate);
foundRemoteRelay = true; foundRemoteRelay = true;
} }

View file

@ -317,7 +317,7 @@ public abstract class FileBasedOmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigP
preKeys.put(Integer.parseInt(f.getName()), p); preKeys.put(Integer.parseInt(f.getName()), p);
} catch (IOException e) { } catch (IOException e) {
//Do nothing // Do nothing.
} }
} }
return preKeys; return preKeys;
@ -355,7 +355,7 @@ public abstract class FileBasedOmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigP
signedPreKeys.put(Integer.parseInt(f.getName()), p); signedPreKeys.put(Integer.parseInt(f.getName()), p);
} catch (IOException e) { } catch (IOException e) {
//Do nothing // Do nothing.
} }
} }
return signedPreKeys; return signedPreKeys;
@ -414,7 +414,7 @@ public abstract class FileBasedOmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigP
sessions.put(id, s); sessions.put(id, s);
} catch (IOException e) { } catch (IOException e) {
//Do nothing // Do nothing.
} }
} }
return sessions; return sessions;