1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

Add checkstyle check for space(s) after tab(s)

This commit is contained in:
Florian Schmaus 2015-03-18 21:51:25 +01:00
parent 8878cf3773
commit 5188c6f934
11 changed files with 52 additions and 29 deletions

View file

@ -27,6 +27,12 @@
<property name="format" value="^ +\t+"/>
<property name="message" value="Line containing tab(s) after space"/>
</module>
<module name="RegexpSingleline">
<!-- We use {2,} instead of + here to address the typical case where a file was written
with tabs but javadoc is causing '\t *' -->
<property name="format" value="^\t+ {2,}"/>
<property name="message" value="Line containing space(s) after tab(s)"/>
</module>
<module name="RegexpSingleline">
<!--
Explaining the following Regex

View file

@ -93,9 +93,8 @@ public class ServerPingWithAlarmManager extends Manager {
}
/**
* If enabled, ServerPingWithAlarmManager will call
* {@link PingManager#pingServerIfNecessary()} for the connection of this
* instance every half hour.
* If enabled, ServerPingWithAlarmManager will call {@link PingManager#pingServerIfNecessary()}
* for the connection of this instance every half hour.
*
* @param enabled
*/
@ -145,10 +144,9 @@ public class ServerPingWithAlarmManager extends Manager {
private static AlarmManager sAlarmManager;
/**
* Register a pending intent with the AlarmManager to be broadcasted every
* half hour and register the alarm broadcast receiver to receive this
* intent. The receiver will check all known questions if a ping is
* Necessary when invoked by the alarm intent.
* Register a pending intent with the AlarmManager to be broadcasted every half hour and
* register the alarm broadcast receiver to receive this intent. The receiver will check all
* known questions if a ping is Necessary when invoked by the alarm intent.
*
* @param context
*/

View file

@ -62,8 +62,8 @@ public class PacketCollectorTest
}
/**
* Although this doesn't guarentee anything due to the nature of threading, it can
* potentially catch problems.
* Although this doesn't guarentee anything due to the nature of threading, it can potentially
* catch problems.
*/
@Test
public void verifyThreadSafety()

View file

@ -354,6 +354,7 @@ public class EnhancedDebugger implements SmackDebugger {
menu.add(menuItem1);
// Add listener to the text area so the popup menu can come up.
messageTextArea.addMouseListener(new PopupListener(menu));
// CHECKSTYLE:OFF
JPanel sublayout = new JPanel(new BorderLayout());
sublayout.add(new JScrollPane(messageTextArea), BorderLayout.CENTER);
@ -365,9 +366,9 @@ public class EnhancedDebugger implements SmackDebugger {
@Override
public void actionPerformed(ActionEvent e) {
messagesTable.setRowCount(0);
}
});
// CHECKSTYLE:ON
sublayout.add(clearb, BorderLayout.NORTH);
allPane.setBottomComponent(sublayout);

View file

@ -187,8 +187,10 @@ public abstract class FileTransfer {
protected void setStatus(Status status) {
synchronized (statusMonitor) {
// CHECKSTYLE:OFF
this.status = status;
}
// CHECKSTYLE:ON
}
protected boolean updateStatus(Status oldStatus, Status newStatus) {

View file

@ -87,7 +87,9 @@ public abstract class StreamNegotiator {
}
protected final IQ initiateIncomingStream(final XMPPConnection connection, StreamInitiation initiation)
// CHECKSTYLE:OFF
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// CHECKSTYLE:ON
final StreamInitiation response = createInitiationAccept(initiation,
getNamespaces());

View file

@ -304,7 +304,9 @@ abstract public class Node
*/
public Subscription subscribe(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException
{
// CHECKSTYLE:OFF
PubSub pubSub = createPubsubPacket(Type.set, new SubscribeExtension(jid, getId()));
// CHECKSTYLE:ON
PubSub reply = sendPubsubPacket(pubSub);
return reply.getExtension(PubSubElementType.SUBSCRIPTION);
}
@ -330,7 +332,9 @@ abstract public class Node
*/
public Subscription subscribe(String jid, SubscribeForm subForm) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException
{
// CHECKSTYLE:OFF
PubSub request = createPubsubPacket(Type.set, new SubscribeExtension(jid, getId()));
// CHECKSTYLE:ON
request.addExtension(new FormNode(FormNodeType.OPTIONS, subForm));
PubSub reply = PubSubManager.sendPubsubPacket(con, request);
return reply.getExtension(PubSubElementType.SUBSCRIPTION);
@ -545,7 +549,9 @@ abstract public class Node
@SuppressWarnings({ "rawtypes", "unchecked" })
public void processPacket(Stanza packet)
{
// CHECKSTYLE:OFF
EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());
// CHECKSTYLE:ON
ItemsExtension itemsElem = (ItemsExtension)event.getEvent();
ItemPublishEvent eventItems = new ItemPublishEvent(itemsElem.getNode(), (List<Item>)itemsElem.getItems(), getSubscriptionIds(packet), DelayInformationManager.getDelayTimestamp(packet));
listener.handlePublishedItems(eventItems);
@ -569,6 +575,7 @@ abstract public class Node
public void processPacket(Stanza packet)
{
// CHECKSTYLE:OFF
EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());
List<ExtensionElement> extList = event.getExtensions();
@ -592,6 +599,7 @@ abstract public class Node
ItemDeleteEvent eventItems = new ItemDeleteEvent(itemsElem.getNode(), items, getSubscriptionIds(packet));
listener.handleDeletedItems(eventItems);
}
// CHECKSTYLE:ON
}
}
@ -612,8 +620,10 @@ abstract public class Node
public void processPacket(Stanza packet)
{
// CHECKSTYLE:OFF
EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());
ConfigurationEvent config = (ConfigurationEvent)event.getEvent();
// CHECKSTYLE:ON
listener.handleNodeConfiguration(config);
}

View file

@ -321,10 +321,12 @@ final public class PubSubManager
static PubSub sendPubsubPacket(XMPPConnection con, Jid to, Type type, List<ExtensionElement> extList, PubSubNamespace ns) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException
{
// CHECKSTYLE:OFF
PubSub pubSub = new PubSub(to, type, ns);
for (ExtensionElement pe : extList) {
pubSub.addExtension(pe);
}
// CHECKSTYLE:ON
return sendPubsubPacket(con ,pubSub);
}

View file

@ -36,6 +36,8 @@ public class EventProvider extends EmbeddedExtensionProvider<EventElement>
@Override
protected EventElement createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends ExtensionElement> content)
{
// CHECKSTYLE:OFF
return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0));
// CHECKSTYLE:ON
}
}