mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-21 22:02:06 +01:00
Add checkstyle check for trailing whitespace
This commit is contained in:
parent
b8f046706b
commit
8878cf3773
14 changed files with 35 additions and 22 deletions
|
@ -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&&[^\*/]]+\s+$"/>
|
||||
<property name="message" value="Line containing trailing whitespace character(s)"/>
|
||||
</module>
|
||||
-->
|
||||
<module name="TreeWalker">
|
||||
<module name="FileContentsHolder"/>
|
||||
<module name="UnusedImports">
|
||||
|
|
|
@ -205,7 +205,7 @@ public class Socks4ProxySocketFactory
|
|||
{
|
||||
try
|
||||
{
|
||||
if(socket!=null)socket.close();
|
||||
if(socket!=null)socket.close();
|
||||
}
|
||||
catch(Exception eee)
|
||||
{
|
||||
|
|
|
@ -340,7 +340,7 @@ public class Socks5ProxySocketFactory
|
|||
{
|
||||
if(socket!=null)
|
||||
{
|
||||
socket.close();
|
||||
socket.close();
|
||||
}
|
||||
}
|
||||
catch(Exception eee)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -232,7 +232,7 @@ public class PacketParserUtils {
|
|||
if (language != null && !"".equals(language.trim())) {
|
||||
message.setLanguage(language);
|
||||
defaultLanguage = language;
|
||||
}
|
||||
}
|
||||
else {
|
||||
defaultLanguage = Stanza.getDefaultLanguage();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -475,7 +475,7 @@ public class MUCUser implements ExtensionElement {
|
|||
if (other instanceof Status) {
|
||||
Status otherStatus = (Status) other;
|
||||
return code.equals(otherStatus.getCode());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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>() {
|
||||
|
|
|
@ -102,7 +102,7 @@ public class OctTreeQuantizer implements Quantizer {
|
|||
if (colors > reduceColors)
|
||||
reduceTree(reduceColors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the color table index for a color.
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue