1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-08 06:01:07 +01:00

Enable more 'checkstyle' checks

AvoidStarImport
IllegalImport
RedundantImport
UpperEll
ArrayTypeStyle
GenericWhitespace
EmptyStatement
PackageDelcaration
This commit is contained in:
Florian Schmaus 2014-08-15 23:16:18 +02:00
parent 522d0f30ff
commit 7277eb553a
92 changed files with 465 additions and 253 deletions

View file

@ -16,14 +16,16 @@
*/
package org.jivesoftware.smackx.amp.packet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.CopyOnWriteArrayList;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.amp.AMPDeliverCondition;
import org.jivesoftware.smackx.amp.AMPExpireAtCondition;
import org.jivesoftware.smackx.amp.AMPMatchResourceCondition;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
public class AMPExtension implements PacketExtension {
public static final String NAMESPACE = "http://jabber.org/protocol/amp";

View file

@ -627,7 +627,7 @@ public class InBandBytestreamSession implements BytestreamSession {
buffer[bufferPointer++] = (byte) b;
}
public synchronized void write(byte b[], int off, int len) throws IOException {
public synchronized void write(byte[] b, int off, int len) throws IOException {
if (b == null) {
throw new NullPointerException();
}
@ -671,7 +671,7 @@ public class InBandBytestreamSession implements BytestreamSession {
* @param len the number of bytes to write
* @throws IOException if an I/O error occurred while sending or if the stream is closed
*/
private synchronized void writeOut(byte b[], int off, int len) throws IOException {
private synchronized void writeOut(byte[] b, int off, int len) throws IOException {
if (this.isClosed) {
throw new IOException("Stream is closed");
}

View file

@ -197,7 +197,7 @@ class Socks5Client {
* @return SOCKS5 connection request message
*/
private byte[] createSocks5ConnectRequest() {
byte addr[] = this.digest.getBytes();
byte[] addr = this.digest.getBytes();
byte[] data = new byte[7 + addr.length];
data[0] = (byte) 0x05; // version (SOCKS5)

View file

@ -17,8 +17,22 @@
package org.jivesoftware.smackx.commands;
import org.jivesoftware.smack.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import org.jivesoftware.smack.ConnectionCreationListener;
import org.jivesoftware.smack.Manager;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPConnectionRegistry;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.filter.PacketTypeFilter;
@ -33,18 +47,10 @@ import org.jivesoftware.smackx.commands.packet.AdHocCommandData;
import org.jivesoftware.smackx.disco.NodeInformationProvider;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity;
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
import org.jivesoftware.smackx.xdata.Form;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
/**
* An AdHocCommandManager is responsible for keeping the list of available
* commands offered by a service and for processing commands requests.

View file

@ -16,6 +16,19 @@
*/
package org.jivesoftware.smackx.filetransfer;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NoResponseException;
@ -27,12 +40,6 @@ import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smackx.si.packet.StreamInitiation;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.concurrent.*;
import java.util.List;
import java.util.ArrayList;
/**
* The fault tolerant negotiator takes two stream negotiators, the primary and the secondary

View file

@ -16,11 +16,21 @@
*/
package org.jivesoftware.smackx.filetransfer;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import java.io.*;
import java.util.concurrent.*;
/**
* An incoming file transfer is created when the

View file

@ -16,14 +16,19 @@
*/
package org.jivesoftware.smackx.filetransfer;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.IllegalStateChangeException;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.packet.XMPPError;
import java.io.*;
/**
* Handles the sending of a file to another user. File transfer's in jabber have
* several steps and there are several methods in this class that handle these

View file

@ -17,8 +17,8 @@
package org.jivesoftware.smackx.muc.provider;
import org.jivesoftware.smack.packet.*;
import org.jivesoftware.smack.provider.*;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smackx.muc.packet.MUCOwner;
import org.xmlpull.v1.XmlPullParser;

View file

@ -16,7 +16,11 @@
*/
package org.jivesoftware.smackx.privacy.packet;
import java.util.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smackx.privacy.PrivacyListManager;

View file

@ -25,7 +25,7 @@ import java.util.List;
*
* @author Robin Collier
*/
public class ItemPublishEvent <T extends Item> extends SubscriptionEvent
public class ItemPublishEvent<T extends Item> extends SubscriptionEvent
{
private List<T> items;
private Date originalDate;

View file

@ -24,7 +24,7 @@ import java.util.Collection;
*
* @author Robin Collier
*/
public class PublishItem <T extends Item> extends NodeExtension
public class PublishItem<T extends Item> extends NodeExtension
{
protected Collection<T> items;

View file

@ -27,7 +27,7 @@ import org.jivesoftware.smackx.pubsub.LeafNode;
*
* @author Robin Collier
*/
public interface ItemEventListener <T extends Item>
public interface ItemEventListener<T extends Item>
{
/**
* Called whenever an item is published to the node the listener

View file

@ -46,7 +46,7 @@ public class SubscriptionProvider implements PacketExtensionProvider
if ((tag == XmlPullParser.START_TAG) && parser.getName().equals("required"))
isRequired = true;
while (parser.next() != XmlPullParser.END_TAG && parser.getName() != "subscribe-options");
while (tag != XmlPullParser.END_TAG && parser.getName() != "subscribe-options") tag = parser.next();
}
while (parser.getEventType() != XmlPullParser.END_TAG) parser.next();
return new Subscription(jid, nodeId, subId, (state == null ? null : Subscription.State.valueOf(state)), isRequired);