mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-24 03:27:59 +01:00
errorprone: Enable MethodCanBeStatic
This commit is contained in:
parent
870d1a7238
commit
34f1c2b79e
15 changed files with 38 additions and 37 deletions
|
@ -203,7 +203,11 @@ allprojects {
|
|||
'-Werror',
|
||||
]
|
||||
options.errorprone {
|
||||
error("UnusedVariable", "UnusedMethod")
|
||||
error(
|
||||
"UnusedVariable",
|
||||
"UnusedMethod",
|
||||
"MethodCanBeStatic",
|
||||
)
|
||||
errorproneArgs = [
|
||||
// Disable errorprone checks
|
||||
'-Xep:TypeParameterUnusedInFormals:OFF',
|
||||
|
|
|
@ -86,7 +86,7 @@ public class MUCLightBlockingIQ extends IQ {
|
|||
return xml;
|
||||
}
|
||||
|
||||
private void parseBlocking(IQChildElementXmlStringBuilder xml, HashMap<Jid, Boolean> map, boolean isRoom) {
|
||||
private static void parseBlocking(IQChildElementXmlStringBuilder xml, HashMap<Jid, Boolean> map, boolean isRoom) {
|
||||
Iterator<Map.Entry<Jid, Boolean>> it = map.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<Jid, Boolean> pair = it.next();
|
||||
|
|
|
@ -74,7 +74,7 @@ public class MediaElementProvider extends FormFieldChildElementProvider<MediaEle
|
|||
return mediaElementBuilder.build();
|
||||
}
|
||||
|
||||
private MediaElement.Uri parseUri(XmlPullParser parser)
|
||||
private static MediaElement.Uri parseUri(XmlPullParser parser)
|
||||
throws SmackUriSyntaxParsingException, XmlPullParserException, IOException {
|
||||
String type = parser.getAttributeValue("type");
|
||||
URI uri = ParserUtils.getUriFromNextText(parser);
|
||||
|
|
|
@ -607,7 +607,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
|
|||
* @param connection TODO javadoc me please
|
||||
* The connection to clean up
|
||||
*/
|
||||
private void unregisterInstanceFor(XMPPConnection connection) {
|
||||
private static void unregisterInstanceFor(XMPPConnection connection) {
|
||||
synchronized (sessions) {
|
||||
sessions.remove(connection);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ public class JingleSessionStateActive extends JingleSessionState {
|
|||
/**
|
||||
* Receive and process the <session-terminate> action.
|
||||
*/
|
||||
private IQ receiveSessionTerminateAction(JingleSession session, Jingle jingle) {
|
||||
private static IQ receiveSessionTerminateAction(JingleSession session, Jingle jingle) {
|
||||
|
||||
// According to XEP-166 the only thing we can do is ack.
|
||||
IQ response = session.createAck(jingle);
|
||||
|
|
|
@ -103,7 +103,7 @@ public class JingleSessionStatePending extends JingleSessionState {
|
|||
/**
|
||||
* Receive and process the <session-accept> action.
|
||||
*/
|
||||
private IQ receiveContentAcceptAction(Jingle inJingle) {
|
||||
private static IQ receiveContentAcceptAction(Jingle inJingle) {
|
||||
|
||||
// According to XEP-167 the only thing we can do is ack.
|
||||
// setSessionState(JingleSessionStateEnum.ACTIVE);
|
||||
|
@ -116,7 +116,7 @@ public class JingleSessionStatePending extends JingleSessionState {
|
|||
/**
|
||||
* Receive and process the <session-accept> action.
|
||||
*/
|
||||
private IQ receiveSessionAcceptAction(JingleSession session, Jingle inJingle) {
|
||||
private static IQ receiveSessionAcceptAction(JingleSession session, Jingle inJingle) {
|
||||
|
||||
// According to XEP-166 the only thing we can do is ack.
|
||||
session.setSessionState(JingleSessionStateActive.getInstance());
|
||||
|
@ -126,7 +126,7 @@ public class JingleSessionStatePending extends JingleSessionState {
|
|||
/**
|
||||
* Receive and process the <session-terminate> action.
|
||||
*/
|
||||
private IQ receiveSessionTerminateAction(JingleSession session, Jingle jingle) {
|
||||
private static IQ receiveSessionTerminateAction(JingleSession session, Jingle jingle) {
|
||||
|
||||
// According to XEP-166 the only thing we can do is ack.
|
||||
IQ response = session.createAck(jingle);
|
||||
|
|
|
@ -101,8 +101,8 @@ public class JingleSessionStateUnknown extends JingleSessionState {
|
|||
* @throws SmackException if Smack detected an exceptional situation.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
*/
|
||||
|
||||
private IQ receiveSessionInitiateAction(JingleSession session, Jingle inJingle) throws SmackException, InterruptedException {
|
||||
private static IQ receiveSessionInitiateAction(JingleSession session, Jingle inJingle)
|
||||
throws SmackException, InterruptedException {
|
||||
|
||||
IQ response;
|
||||
boolean shouldAck = true;
|
||||
|
@ -208,7 +208,7 @@ public class JingleSessionStateUnknown extends JingleSessionState {
|
|||
/**
|
||||
* Receive and process the <session-terminate> action.
|
||||
*/
|
||||
private IQ receiveSessionTerminateAction(JingleSession session, Jingle jingle) {
|
||||
private static IQ receiveSessionTerminateAction(JingleSession session, Jingle jingle) {
|
||||
|
||||
// According to XEP-166 the only thing we can do is ack.
|
||||
IQ response = session.createAck(jingle);
|
||||
|
|
|
@ -183,7 +183,7 @@ public class MediaNegotiator extends JingleNegotiator {
|
|||
/**
|
||||
* Process the ACK of our list of codecs (our offer).
|
||||
*/
|
||||
private Jingle receiveResult(IQ iq) throws XMPPException {
|
||||
private static Jingle receiveResult(IQ iq) throws XMPPException {
|
||||
Jingle response = null;
|
||||
|
||||
// if (!remoteAudioPts.isEmpty()) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
}
|
||||
catch (Exception e) {
|
||||
|
||||
message("Failed to commit to JMFRegistry!");
|
||||
LOGGER.fine("Failed to commit to JMFRegistry!");
|
||||
}
|
||||
|
||||
Thread detectThread = new Thread(this);
|
||||
|
@ -89,28 +89,28 @@ public class JMFInit extends Frame implements Runnable {
|
|||
if (args != null && args.length > 0) {
|
||||
tempDir = args[0];
|
||||
|
||||
message("Setting cache directory to " + tempDir);
|
||||
LOGGER.fine("Setting cache directory to " + tempDir);
|
||||
try {
|
||||
Registry.set("secure.cacheDir", tempDir);
|
||||
Registry.commit();
|
||||
|
||||
message("Updated registry");
|
||||
LOGGER.fine("Updated registry");
|
||||
}
|
||||
catch (Exception e) {
|
||||
message("Couldn't update registry!");
|
||||
LOGGER.fine("Couldn't update registry!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("LiteralClassName")
|
||||
private void detectCaptureDevices() {
|
||||
private static void detectCaptureDevices() {
|
||||
// check if JavaSound capture is available
|
||||
message("Looking for Audio capturer");
|
||||
LOGGER.fine("Looking for Audio capturer");
|
||||
Class<?> dsauto;
|
||||
try {
|
||||
dsauto = Class.forName("DirectSoundAuto");
|
||||
dsauto.getConstructor().newInstance();
|
||||
message("Finished detecting DirectSound capturer");
|
||||
LOGGER.fine("Finished detecting DirectSound capturer");
|
||||
}
|
||||
catch (ThreadDeath td) {
|
||||
throw td;
|
||||
|
@ -123,13 +123,13 @@ public class JMFInit extends Frame implements Runnable {
|
|||
try {
|
||||
jsauto = Class.forName("JavaSoundAuto");
|
||||
jsauto.getConstructor().newInstance();
|
||||
message("Finished detecting javasound capturer");
|
||||
LOGGER.fine("Finished detecting javasound capturer");
|
||||
}
|
||||
catch (ThreadDeath td) {
|
||||
throw td;
|
||||
}
|
||||
catch (Throwable t) {
|
||||
message("JavaSound capturer detection failed!");
|
||||
LOGGER.fine("JavaSound capturer detection failed!");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -182,7 +182,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
*/
|
||||
}
|
||||
|
||||
private void detectDirectAudio() {
|
||||
private static void detectDirectAudio() {
|
||||
Class<?> cls;
|
||||
int plType = PlugInManager.RENDERER;
|
||||
String dar = "com.sun.media.renderer.audio.DirectAudioRenderer";
|
||||
|
@ -229,7 +229,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
private void detectS8DirectAudio() {
|
||||
private static void detectS8DirectAudio() {
|
||||
Class<?> cls;
|
||||
int plType = PlugInManager.RENDERER;
|
||||
String dar = "com.sun.media.renderer.audio.DirectAudioRenderer";
|
||||
|
@ -273,10 +273,6 @@ public class JMFInit extends Frame implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
private void message(String mesg) {
|
||||
LOGGER.fine(mesg);
|
||||
}
|
||||
|
||||
public static void start(boolean visible) {
|
||||
new JMFInit(null, visible);
|
||||
}
|
||||
|
|
|
@ -318,7 +318,7 @@ public class AudioChannel {
|
|||
* @return the best stanza size
|
||||
* @throws IllegalArgumentException if an illegal argument was given.
|
||||
*/
|
||||
private int getPacketSize(Format codecFormat, int milliseconds) throws IllegalArgumentException {
|
||||
private static int getPacketSize(Format codecFormat, int milliseconds) throws IllegalArgumentException {
|
||||
String encoding = codecFormat.getEncoding();
|
||||
if (encoding.equalsIgnoreCase(AudioFormat.GSM) ||
|
||||
encoding.equalsIgnoreCase(AudioFormat.GSM_RTP)) {
|
||||
|
|
|
@ -252,7 +252,7 @@ public class STUNResolver extends TransportResolver {
|
|||
*
|
||||
* @return the best STUN server that can be used.
|
||||
*/
|
||||
private STUNService bestSTUNServer(ArrayList<STUNService> listServers) {
|
||||
private static STUNService bestSTUNServer(ArrayList<STUNService> listServers) {
|
||||
if (listServers.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
|
|
|
@ -115,8 +115,8 @@ public class AgentChatHistory extends IQ {
|
|||
return agentChatHistory;
|
||||
}
|
||||
|
||||
private AgentChatSession parseChatSetting(XmlPullParser parser) throws XmlPullParserException, IOException {
|
||||
|
||||
private static AgentChatSession parseChatSetting(XmlPullParser parser)
|
||||
throws XmlPullParserException, IOException {
|
||||
boolean done = false;
|
||||
Date date = null;
|
||||
long duration = 0;
|
||||
|
|
|
@ -131,7 +131,7 @@ public class AgentStatusRequest extends IQ {
|
|||
return statusRequest;
|
||||
}
|
||||
|
||||
private Item parseAgent(XmlPullParser parser) throws XmlPullParserException, IOException {
|
||||
private static Item parseAgent(XmlPullParser parser) throws XmlPullParserException, IOException {
|
||||
|
||||
boolean done = false;
|
||||
EntityBareJid jid = ParserUtils.getBareJidAttribute(parser);
|
||||
|
|
|
@ -154,8 +154,8 @@ public class OccupantsInfo extends IQ {
|
|||
return occupantsInfo;
|
||||
}
|
||||
|
||||
private OccupantInfo parseOccupantInfo(XmlPullParser parser) throws XmlPullParserException, IOException, SmackTextParseException {
|
||||
|
||||
private static OccupantInfo parseOccupantInfo(XmlPullParser parser)
|
||||
throws XmlPullParserException, IOException, SmackTextParseException {
|
||||
boolean done = false;
|
||||
String jid = null;
|
||||
String nickname = null;
|
||||
|
|
|
@ -69,8 +69,8 @@ public class TranscriptsProvider extends IQProvider<Transcripts> {
|
|||
return new Transcripts(userID, summaries);
|
||||
}
|
||||
|
||||
private Transcripts.TranscriptSummary parseSummary(XmlPullParser parser) throws IOException,
|
||||
XmlPullParserException {
|
||||
private static Transcripts.TranscriptSummary parseSummary(XmlPullParser parser)
|
||||
throws IOException, XmlPullParserException {
|
||||
String sessionID = parser.getAttributeValue("", "sessionID");
|
||||
Date joinTime = null;
|
||||
Date leftTime = null;
|
||||
|
@ -108,7 +108,8 @@ public class TranscriptsProvider extends IQProvider<Transcripts> {
|
|||
return new Transcripts.TranscriptSummary(sessionID, joinTime, leftTime, agents);
|
||||
}
|
||||
|
||||
private List<Transcripts.AgentDetail> parseAgents(XmlPullParser parser) throws IOException, XmlPullParserException {
|
||||
private static List<Transcripts.AgentDetail> parseAgents(XmlPullParser parser)
|
||||
throws IOException, XmlPullParserException {
|
||||
List<Transcripts.AgentDetail> agents = new ArrayList<>();
|
||||
String agentJID = null;
|
||||
Date joinTime = null;
|
||||
|
|
Loading…
Reference in a new issue