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="message" value="Line containing trailing whitespace character(s)"/>
</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="TreeWalker">
<module name="FinalClass"/>

View File

@ -532,7 +532,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
}
break;
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))) {
throw new StreamErrorException(PacketParserUtils.parseStreamError(parser));
} else {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -58,7 +58,7 @@ public class MamIntegrationTest extends AbstractSmackIntegrationTest {
EntityBareJid userOne = conOne.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);
Message message = new Message(userTwo);

View File

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

View File

@ -359,7 +359,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
if (candidate instanceof ICECandidate) {
ICECandidate iceCandidate = (ICECandidate) candidate;
if (iceCandidate.getType().equals(Type.relay)) {
//TODO Check if the relay is reacheable
// TODO Check if the relay is reacheable.
addValidRemoteCandidate(iceCandidate);
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);
} catch (IOException e) {
//Do nothing
// Do nothing.
}
}
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);
} catch (IOException e) {
//Do nothing
// Do nothing.
}
}
return signedPreKeys;
@ -414,7 +414,7 @@ public abstract class FileBasedOmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigP
sessions.put(id, s);
} catch (IOException e) {
//Do nothing
// Do nothing.
}
}
return sessions;