Add checkstyle check for trailing whitespace

This commit is contained in:
Florian Schmaus 2015-03-18 21:01:49 +01:00
parent b8f046706b
commit 8878cf3773
14 changed files with 35 additions and 22 deletions

View File

@ -27,12 +27,25 @@
<property name="format" value="^ +\t+"/>
<property name="message" value="Line containing tab(s) after space"/>
</module>
<!-- TODO enable this once eclilpse does no longer add javadoc with trailing whitespaces
<module name="RegexpSingleline">
<property name="format" value="^.*\S+\s+$"/>
<!--
Explaining the following Regex
^ \s* [\S && [^ \*/]]+ \s+ $
| | | | | +- End of Line (6)
| | | | +- At least one whitespace (5)
| | | +- At least one or more of the previous character class (4)
| | +- All non-whitespace characters except '*' and '/' (to exclude javadoc) (3)
| +- Zero or more space characters (2)
+- Start of Line (1)
Rationale:
Matches trailing whitespace (5) in lines containing at least one (4) non-whitespace character
that is not one of the characters used by javadoc (3).
-->
<property name="format" value="^\s*[\S&amp;&amp;[^\*/]]+\s+$"/>
<property name="message" value="Line containing trailing whitespace character(s)"/>
</module>
-->
<module name="TreeWalker">
<module name="FileContentsHolder"/>
<module name="UnusedImports">

View File

@ -205,7 +205,7 @@ public class Socks4ProxySocketFactory
{
try
{
if(socket!=null)socket.close();
if(socket!=null)socket.close();
}
catch(Exception eee)
{

View File

@ -340,7 +340,7 @@ public class Socks5ProxySocketFactory
{
if(socket!=null)
{
socket.close();
socket.close();
}
}
catch(Exception eee)

View File

@ -254,7 +254,7 @@ public class DNSUtil {
} else {
double rnd = Math.random() * running_total;
selectedPos = bisect(totals, rnd);
}
}
// add the SRVRecord that was randomly chosen on it's weight
// to the start of the result list
SRVRecord chosenSRVRecord = bucket.remove(selectedPos);

View File

@ -232,7 +232,7 @@ public class PacketParserUtils {
if (language != null && !"".equals(language.trim())) {
message.setLanguage(language);
defaultLanguage = language;
}
}
else {
defaultLanguage = Stanza.getDefaultLanguage();
}

View File

@ -37,7 +37,7 @@ public class SmackConfigurationTest {
// As there is currently no annotation/way to run a testclass/single test in a separate VM,
// which is required for reliable results of this test, and we don't want to fork a VM for
// *every* test, those tests are currently disabled. Hopefully this will change in the future.
@Ignore
@Ignore
@Test
public void smackConfigurationShouldNotCauseInitializationTest() {
SmackConfiguration.getDefaultPacketReplyTimeout();
@ -49,7 +49,7 @@ public class SmackConfigurationTest {
// As there is currently no annotation/way to run a testclass/single test in a separate VM,
// which is required for reliable results of this test, and we don't want to fork a VM for
// *every* test, those tests are currently disabled. Hopefully this will change in the future.
@Ignore
@Ignore
@Test
public void smackconfigurationVersionShouldInitialzieSmacktTest() {
SmackConfiguration.getVersion();

View File

@ -475,7 +475,7 @@ public class MUCUser implements ExtensionElement {
if (other instanceof Status) {
Status otherStatus = (Status) other;
return code.equals(otherStatus.getCode());
}
}
return false;
}

View File

@ -25,19 +25,19 @@ package org.jivesoftware.smackx.pubsub;
public enum EventElementType
{
/** A node has been associated or dissassociated with a collection node */
collection,
collection,
/** A node has had its configuration changed */
configuration,
configuration,
/** A node has been deleted */
delete,
delete,
/** Items have been published to a node */
items,
items,
/** All items have been purged from a node */
purge,
purge,
/** A node has been subscribed to */
subscription

View File

@ -39,7 +39,7 @@ import org.jivesoftware.smackx.xdata.packet.DataForm;
* @author Robin Collier
*/
public class SubscribeForm extends Form
{
{
public SubscribeForm(DataForm configDataForm)
{
super(configDataForm);

View File

@ -48,7 +48,7 @@ public class ItemProvider extends ExtensionElementProvider<Item>
{
return new Item(id, node);
}
else
else
{
String payloadElemName = parser.getName();
String payloadNS = parser.getNamespace();
@ -59,7 +59,7 @@ public class ItemProvider extends ExtensionElementProvider<Item>
CharSequence payloadText = PacketParserUtils.parseElement(parser, true);
return new PayloadItem<SimplePayload>(id, node, new SimplePayload(payloadElemName, payloadNS, payloadText));
}
else
else
{
return new PayloadItem<ExtensionElement>(id, node, extensionProvider.parse(parser));
}

View File

@ -100,7 +100,7 @@ public class ChatManager extends Manager{
* Will attempt to match on the JID in the from field, and then attempt the base JID if no match was found.
* This is the most lenient matching.
*/
BARE_JID;
BARE_JID;
}
private final StanzaFilter packetFilter = new OrFilter(MessageTypeFilter.CHAT, new FlexibleStanzaTypeFilter<Message>() {

View File

@ -102,7 +102,7 @@ public class OctTreeQuantizer implements Quantizer {
if (colors > reduceColors)
reduceTree(reduceColors);
}
}
}
/**
* Get the color table index for a color.

View File

@ -102,7 +102,7 @@ public class TcpUdpBridgeClient {
InputStream in = localTcpSocket.getInputStream();
InetAddress remoteHost = InetAddress.getByName(remoteUdpHost);
process.start();
process.start();
while (true) {
byte[] b = new byte[500];

View File

@ -173,7 +173,7 @@ public class QueueDetails implements ExtensionElement {
eventType = parser.next();
while ((eventType != XmlPullParser.END_TAG)
|| (! "user".equals(parser.getName())))
{
{
if ("position".equals(parser.getName())) {
position = Integer.parseInt(parser.nextText());
}