1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02: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

@ -17,11 +17,16 @@
package org.jivesoftware.smack;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.RosterPacket;
import java.util.*;
/**
* Each user in your roster is represented by a roster entry, which contains the user's

View file

@ -20,7 +20,10 @@ import org.jivesoftware.smack.ConnectionListener;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.util.*;
import org.jivesoftware.smack.util.ObservableReader;
import org.jivesoftware.smack.util.ObservableWriter;
import org.jivesoftware.smack.util.ReaderListener;
import org.jivesoftware.smack.util.WriterListener;
import org.jxmpp.util.XmppStringUtils;
import java.io.Reader;

View file

@ -17,9 +17,10 @@
package org.jivesoftware.smack.debugger;
import java.io.*;
import java.io.Reader;
import java.io.Writer;
import org.jivesoftware.smack.*;
import org.jivesoftware.smack.PacketListener;
/**
* Interface that allows for implementing classes to debug XML traffic. That is a GUI window that

View file

@ -17,7 +17,10 @@
package org.jivesoftware.smack.packet;
import java.util.*;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.jivesoftware.smack.util.XmlStringBuilder;

View file

@ -17,9 +17,15 @@
package org.jivesoftware.smack.packet;
import org.jivesoftware.smack.util.XmlStringBuilder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.*;
import org.jivesoftware.smack.util.XmlStringBuilder;
/**
* Represents XMPP message packets. A message can be one of several types:

View file

@ -22,7 +22,6 @@ import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smack.util.PacketParserUtils;
import org.xmlpull.v1.XmlPullParser;

View file

@ -203,7 +203,7 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
*/
public final void challengeReceived(String challengeString, boolean finalChallenge) throws SmackException, NotConnectedException {
byte[] challenge = StringUtils.decodeBase64(challengeString);
byte response[] = evaluateChallenge(challenge);
byte[] response = evaluateChallenge(challenge);
if (finalChallenge) {
return;
}

View file

@ -108,8 +108,8 @@ public class Base32Encoder implements StringEncoder {
ByteArrayOutputStream os = new ByteArrayOutputStream();
for (int i = 0; i < (b.length + 4) / 5; i++) {
short s[] = new short[5];
int t[] = new int[8];
short[] s = new short[5];
int[] t = new int[8];
int blocklen = 5;
for (int j = 0; j < 5; j++) {

View file

@ -16,7 +16,14 @@
*/
package org.jivesoftware.smack.util;
import java.util.*;
import java.util.AbstractCollection;
import java.util.AbstractSet;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
/**

View file

@ -106,7 +106,7 @@ public final class FileUtils {
Reader reader = null;
try {
reader = new FileReader(file);
char buf[] = new char[8192];
char[] buf = new char[8192];
int len;
StringBuilder s = new StringBuilder();
while ((len = reader.read(buf)) >= 0) {

View file

@ -16,8 +16,11 @@
*/
package org.jivesoftware.smack.util;
import java.io.*;
import java.util.*;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
/**
* An ObservableReader is a wrapper on a Reader that notifies to its listeners when
@ -59,7 +62,7 @@ public class ObservableReader extends Reader {
return wrappedReader.read();
}
public int read(char cbuf[]) throws IOException {
public int read(char[] cbuf) throws IOException {
return wrappedReader.read(cbuf);
}

View file

@ -16,8 +16,10 @@
*/
package org.jivesoftware.smack.util;
import java.io.*;
import java.util.*;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
/**
* An ObservableWriter is a wrapper on a Writer that notifies to its listeners when
@ -34,7 +36,7 @@ public class ObservableWriter extends Writer {
this.wrappedWriter = wrappedWriter;
}
public void write(char cbuf[], int off, int len) throws IOException {
public void write(char[] cbuf, int off, int len) throws IOException {
wrappedWriter.write(cbuf, off, len);
String str = new String(cbuf, off, len);
notifyListeners(str);
@ -52,7 +54,7 @@ public class ObservableWriter extends Writer {
wrappedWriter.write(c);
}
public void write(char cbuf[]) throws IOException {
public void write(char[] cbuf) throws IOException {
wrappedWriter.write(cbuf);
String str = new String(cbuf);
notifyListeners(str);

View file

@ -344,7 +344,7 @@ public class PacketParserUtils {
// XmlPullParser reports namespaces in nested elements even if *only* the outer ones defines
// it. This 'flag' ensures that when a namespace is set for an element, it won't be set again
// in a nested element. It's an ugly workaround that has the potential to break things.
String namespaceElement = null;;
String namespaceElement = null;
while (true) {
if (event == XmlPullParser.START_TAG) {
xml.halfOpenElement(parser.getName());

View file

@ -23,14 +23,8 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.ConnectionCreationListener;
import org.jivesoftware.smack.ConnectionListener;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.Roster;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Packet;
/**

View file

@ -17,7 +17,12 @@
package org.jivesoftware.smack;
import static org.junit.Assert.*;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Collection;
import java.util.Collections;
@ -552,7 +557,7 @@ public class RosterTest {
connection.processPacket(rosterResult);
break;
}
};
}
}
/**

View file

@ -16,9 +16,10 @@
*/
package org.jivesoftware.smack.packet;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import org.jivesoftware.smack.packet.StreamError;
import org.jivesoftware.smack.util.PacketParserUtils;
import org.junit.Test;
import org.xmlpull.v1.XmlPullParser;

View file

@ -22,12 +22,6 @@ import java.util.Collection;
import org.junit.Assert;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.ExtensionProviderInfo;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smack.provider.IQProviderInfo;
import org.jivesoftware.smack.provider.ProviderFileLoader;
import org.jivesoftware.smack.provider.ProviderLoader;
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smack.util.FileUtils;
import org.junit.Test;
import org.xmlpull.v1.XmlPullParser;