Skip to content

Commit

Permalink
Add checkstyle check for space(s) after tab(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowdalic committed Mar 18, 2015
1 parent 8878cf3 commit 5188c6f
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 29 deletions.
6 changes: 6 additions & 0 deletions config/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@ private ServerPingWithAlarmManager(XMPPConnection connection) {
super(connection);
}

/**
* If enabled, ServerPingWithAlarmManager will call
* {@link PingManager#pingServerIfNecessary()} for the connection of this
* instance every half hour.
*
* @param enabled
*/
/**
* If enabled, ServerPingWithAlarmManager will call {@link PingManager#pingServerIfNecessary()}
* for the connection of this instance every half hour.
*
* @param enabled
*/
public void setEnabled(boolean enabled) {
mEnabled = enabled;
}
Expand Down Expand Up @@ -144,14 +143,13 @@ public void run() {
private static PendingIntent sPendingIntent;
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.
*
* @param context
*/
/**
* 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
*/
public static void onCreate(Context context) {
sContext = context;
context.registerReceiver(ALARM_BROADCAST_RECEIVER, new IntentFilter(PING_ALARM_ACTION));
Expand All @@ -162,9 +160,9 @@ public static void onCreate(Context context) {
AlarmManager.INTERVAL_HALF_HOUR, sPendingIntent);
}

/**
* Unregister the alarm broadcast receiver and cancel the alarm.
*/
/**
* Unregister the alarm broadcast receiver and cancel the alarm.
*/
public static void onDestroy() {
sContext.unregisterReceiver(ALARM_BROADCAST_RECEIVER);
sAlarmManager.cancel(sPendingIntent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public void verifyRollover() throws InterruptedException
assertNull(collector.nextResult(1000));
}

/**
* 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()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void testEscapeForXML() {
}

public static void assertCharSequenceEquals(CharSequence expected, CharSequence actual) {
assertEquals(expected.toString(), actual.toString());
assertEquals(expected.toString(), actual.toString());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ public void actionPerformed(ActionEvent e) {
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);

Expand All @@ -365,9 +366,9 @@ public void actionPerformed(ActionEvent e) {
@Override
public void actionPerformed(ActionEvent e) {
messagesTable.setRowCount(0);

}
});
// CHECKSTYLE:ON

sublayout.add(clearb, BorderLayout.NORTH);
allPane.setBottomComponent(sublayout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ protected void setException(Exception exception) {

protected void setStatus(Status status) {
synchronized (statusMonitor) {
// CHECKSTYLE:OFF
this.status = status;
}
// CHECKSTYLE:ON
}

protected boolean updateStatus(Status oldStatus, Status newStatus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ protected static StreamInitiation createInitiationAccept(
}

protected final IQ initiateIncomingStream(final XMPPConnection connection, StreamInitiation initiation)
// CHECKSTYLE:OFF
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// CHECKSTYLE:ON
final StreamInitiation response = createInitiationAccept(initiation,
getNamespaces());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ public List<Affiliation> getAffiliations(List<ExtensionElement> additionalExtens
*/
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);
}
Expand All @@ -330,7 +332,9 @@ public Subscription subscribe(String jid) throws NoResponseException, XMPPErrorE
*/
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);
Expand Down Expand Up @@ -545,7 +549,9 @@ public ItemEventTranslator(@SuppressWarnings("rawtypes") ItemEventListener event
@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);
Expand All @@ -569,6 +575,7 @@ public ItemDeleteTranslator(ItemDeleteListener eventListener)

public void processPacket(Stanza packet)
{
// CHECKSTYLE:OFF
EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());

List<ExtensionElement> extList = event.getExtensions();
Expand All @@ -592,6 +599,7 @@ public void processPacket(Stanza packet)
ItemDeleteEvent eventItems = new ItemDeleteEvent(itemsElem.getNode(), items, getSubscriptionIds(packet));
listener.handleDeletedItems(eventItems);
}
// CHECKSTYLE:ON
}
}

Expand All @@ -612,8 +620,10 @@ public NodeConfigTranslator(NodeConfigListener eventListener)

public void processPacket(Stanza packet)
{
// CHECKSTYLE:OFF
EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());
ConfigurationEvent config = (ConfigurationEvent)event.getEvent();
ConfigurationEvent config = (ConfigurationEvent)event.getEvent();
// CHECKSTYLE:ON

listener.handleNodeConfiguration(config);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,12 @@ private PubSub sendPubsubPacket(Type type, ExtensionElement ext, PubSubNamespace

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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public class Base64
public final static int URL_SAFE = 16;


/**
* Encode using the special "ordered" dialect of Base64 described here:
* <a href="http://www.faqs.org/qa/rfcc-1940.html">http://www.faqs.org/qa/rfcc-1940.html</a>.
*/
/**
* Encode using the special "ordered" dialect of Base64 described here:
* <a href="http://www.faqs.org/qa/rfcc-1940.html">http://www.faqs.org/qa/rfcc-1940.html</a>.
*/
public final static int ORDERED = 32;


Expand Down

0 comments on commit 5188c6f

Please sign in to comment.