mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 00:59:39 +02:00
errorprone: Enable MethodCanBeStatic
This commit is contained in:
parent
870d1a7238
commit
34f1c2b79e
15 changed files with 38 additions and 37 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue