mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 00:59:39 +02:00
[build] Bump error prone from 2.9.0 to 2.32.0
This commit is contained in:
parent
07d9d694da
commit
beacb5eb8e
69 changed files with 265 additions and 255 deletions
|
@ -43,7 +43,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
|
||||
private boolean visible = false;
|
||||
|
||||
@SuppressWarnings("this-escape")
|
||||
@SuppressWarnings({"this-escape", "DoNotCall"})
|
||||
public JMFInit(String[] args, boolean visible) {
|
||||
super("Initializing JMF...");
|
||||
|
||||
|
|
|
@ -76,12 +76,12 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
|
|||
public static MediaSession createSession(String localhost, int localPort, String remoteHost, int remotePort, MediaSessionListener eventHandler, int quality, boolean secure, boolean micOn) throws NoProcessorException, UnsupportedFormatException, IOException, GeneralSecurityException {
|
||||
|
||||
SpeexFormat.setFramesPerPacket(1);
|
||||
/**
|
||||
/*
|
||||
* The master key. Hardcoded for now.
|
||||
*/
|
||||
byte[] masterKey = new byte[] {(byte) 0xE1, (byte) 0xF9, 0x7A, 0x0D, 0x3E, 0x01, (byte) 0x8B, (byte) 0xE0, (byte) 0xD6, 0x4F, (byte) 0xA3, 0x2C, 0x06, (byte) 0xDE, 0x41, 0x39};
|
||||
|
||||
/**
|
||||
/*
|
||||
* The master salt. Hardcoded for now.
|
||||
*/
|
||||
byte[] masterSalt = new byte[] {0x0E, (byte) 0xC6, 0x75, (byte) 0xAD, 0x49, (byte) 0x8A, (byte) 0xFE, (byte) 0xEB, (byte) 0xB6, (byte) 0x96, 0x0B, 0x3A, (byte) 0xAB, (byte) 0xE6};
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.net.SocketException;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
@ -135,7 +136,7 @@ public class STUNResolver extends TransportResolver {
|
|||
* @param stunConfigStream An InputStream with the configuration file.
|
||||
* @return A list of loaded servers
|
||||
*/
|
||||
public ArrayList<STUNService> loadSTUNServers(java.io.InputStream stunConfigStream) {
|
||||
public List<STUNService> loadSTUNServers(java.io.InputStream stunConfigStream) {
|
||||
ArrayList<STUNService> serversList = new ArrayList<>();
|
||||
String serverName;
|
||||
int serverPort;
|
||||
|
@ -211,7 +212,7 @@ public class STUNResolver extends TransportResolver {
|
|||
*
|
||||
* @return a list of services
|
||||
*/
|
||||
public ArrayList<STUNService> loadSTUNServers() {
|
||||
public List<STUNService> loadSTUNServers() {
|
||||
ArrayList<STUNService> serversList = new ArrayList<>();
|
||||
|
||||
// Load the STUN configuration
|
||||
|
@ -248,7 +249,7 @@ public class STUNResolver extends TransportResolver {
|
|||
*
|
||||
* @return the best STUN server that can be used.
|
||||
*/
|
||||
private static STUNService bestSTUNServer(ArrayList<STUNService> listServers) {
|
||||
private static STUNService bestSTUNServer(List<STUNService> listServers) {
|
||||
if (listServers.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
package org.jivesoftware.smackx.jingleold.nat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.DatagramPacket;
|
||||
import java.net.DatagramSocket;
|
||||
import java.net.InetAddress;
|
||||
import java.net.SocketException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
@ -661,21 +661,13 @@ public abstract class TransportCandidate {
|
|||
String local = id.substring(0, keySplitIndex) + ";" + localUser;
|
||||
String remote = id.substring(keySplitIndex) + ";" + remoteUser;
|
||||
|
||||
try {
|
||||
if (session.getConnection().getUser().equals(session.getInitiator())) {
|
||||
|
||||
this.send = local.getBytes("UTF-8");
|
||||
this.receive = remote.getBytes("UTF-8");
|
||||
} else {
|
||||
this.receive = local.getBytes("UTF-8");
|
||||
this.send = remote.getBytes("UTF-8");
|
||||
}
|
||||
if (session.getConnection().getUser().equals(session.getInitiator())) {
|
||||
this.send = local.getBytes(StandardCharsets.UTF_8);
|
||||
this.receive = remote.getBytes(StandardCharsets.UTF_8);
|
||||
} else {
|
||||
this.receive = local.getBytes(StandardCharsets.UTF_8);
|
||||
this.send = remote.getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOGGER.log(Level.WARNING, "exception", e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
|
@ -706,7 +698,7 @@ public abstract class TransportCandidate {
|
|||
|
||||
long delay = 100 / replyTries;
|
||||
|
||||
String[] str = new String(packet.getData(), "UTF-8").split(";");
|
||||
String[] str = new String(packet.getData(), StandardCharsets.UTF_8).split(";");
|
||||
String pass = str[0];
|
||||
String[] address = str[1].split(":");
|
||||
String ip = address[0];
|
||||
|
@ -714,13 +706,7 @@ public abstract class TransportCandidate {
|
|||
|
||||
if (pass.equals(candidate.getPassword()) && !accept) {
|
||||
|
||||
byte[] cont = null;
|
||||
try {
|
||||
cont = (password + ";" + candidate.getIp() + ":" + candidate.getPort()).getBytes("UTF-8");
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOGGER.log(Level.WARNING, "exception", e);
|
||||
}
|
||||
byte[] cont = (password + ";" + candidate.getIp() + ":" + candidate.getPort()).getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
packet.setData(cont);
|
||||
packet.setLength(cont.length);
|
||||
|
@ -778,31 +764,24 @@ public abstract class TransportCandidate {
|
|||
DatagramListener listener = new DatagramListener() {
|
||||
@Override
|
||||
public boolean datagramReceived(DatagramPacket datagramPacket) {
|
||||
LOGGER.fine("ECHO Received to: " + candidate.getIp() + ":" + candidate.getPort() + " data: " + new String(datagramPacket.getData(), StandardCharsets.UTF_8));
|
||||
String[] str = new String(datagramPacket.getData(), StandardCharsets.UTF_8).split(";");
|
||||
String pass = str[0];
|
||||
String[] addr = str[1].split(":");
|
||||
String ip = addr[0];
|
||||
String pt = addr[1];
|
||||
|
||||
try {
|
||||
LOGGER.fine("ECHO Received to: " + candidate.getIp() + ":" + candidate.getPort() + " data: " + new String(datagramPacket.getData(), "UTF-8"));
|
||||
String[] str = new String(datagramPacket.getData(), "UTF-8").split(";");
|
||||
String pass = str[0];
|
||||
String[] addr = str[1].split(":");
|
||||
String ip = addr[0];
|
||||
String pt = addr[1];
|
||||
|
||||
// CHECKSTYLE:OFF
|
||||
if (pass.equals(password)
|
||||
&& transportCandidate.getIp().indexOf(ip) != -1
|
||||
&& transportCandidate.getPort() == Integer.parseInt(pt)) {
|
||||
// CHECKSTYLE:ON
|
||||
LOGGER.fine("ECHO OK: " + candidate.getIp() + ":" + candidate.getPort() + " <-> " + transportCandidate.getIp() + ":" + transportCandidate.getPort());
|
||||
TestResult testResult = new TestResult();
|
||||
testResult.setResult(true);
|
||||
ended = true;
|
||||
fireTestResult(testResult, transportCandidate);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOGGER.log(Level.WARNING, "exception", e);
|
||||
// CHECKSTYLE:OFF
|
||||
if (pass.equals(password)
|
||||
&& transportCandidate.getIp().indexOf(ip) != -1
|
||||
&& transportCandidate.getPort() == Integer.parseInt(pt)) {
|
||||
// CHECKSTYLE:ON
|
||||
LOGGER.fine("ECHO OK: " + candidate.getIp() + ":" + candidate.getPort() + " <-> " + transportCandidate.getIp() + ":" + transportCandidate.getPort());
|
||||
TestResult testResult = new TestResult();
|
||||
testResult.setResult(true);
|
||||
ended = true;
|
||||
fireTestResult(testResult, transportCandidate);
|
||||
return true;
|
||||
}
|
||||
|
||||
LOGGER.fine("ECHO Wrong Data: " + datagramPacket.getAddress().getHostAddress() + ":" + datagramPacket.getPort());
|
||||
|
@ -812,13 +791,7 @@ public abstract class TransportCandidate {
|
|||
|
||||
addListener(listener);
|
||||
|
||||
byte[] content = null;
|
||||
try {
|
||||
content = new String(password + ";" + getIp() + ":" + getPort()).getBytes("UTF-8");
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOGGER.log(Level.WARNING, "exception", e);
|
||||
}
|
||||
byte[] content = new String(password + ";" + getIp() + ":" + getPort()).getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
DatagramPacket packet = new DatagramPacket(content, content.length);
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
// Sleep for some time, waiting for the candidates checks
|
||||
|
||||
int totalTime = CANDIDATES_ACCEPT_PERIOD + TransportResolver.CHECK_TIMEOUT;
|
||||
int tries = (int) Math.ceil(totalTime / 1000);
|
||||
int tries = (int) Math.ceil(totalTime / 1000.0);
|
||||
|
||||
for (int i = 0; i < tries - 1; i++) {
|
||||
try {
|
||||
|
@ -478,7 +478,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
*
|
||||
* @return The list of valid (ie, already checked) remote candidates.
|
||||
*/
|
||||
final ArrayList<TransportCandidate> getValidRemoteCandidatesList() {
|
||||
final List<TransportCandidate> getValidRemoteCandidatesList() {
|
||||
synchronized (validRemoteCandidates) {
|
||||
return new ArrayList<>(validRemoteCandidates);
|
||||
}
|
||||
|
@ -872,7 +872,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
@Override
|
||||
public TransportCandidate getBestRemoteCandidate() {
|
||||
// Hopefully, we only have one validRemoteCandidate
|
||||
ArrayList<TransportCandidate> cands = getValidRemoteCandidatesList();
|
||||
List<TransportCandidate> cands = getValidRemoteCandidatesList();
|
||||
if (!cands.isEmpty()) {
|
||||
LOGGER.fine("RAW CAND");
|
||||
return cands.get(0);
|
||||
|
@ -930,7 +930,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
public TransportCandidate getBestRemoteCandidate() {
|
||||
ICECandidate result = null;
|
||||
|
||||
ArrayList<TransportCandidate> cands = getValidRemoteCandidatesList();
|
||||
List<TransportCandidate> cands = getValidRemoteCandidatesList();
|
||||
if (!cands.isEmpty()) {
|
||||
int highest = -1;
|
||||
ICECandidate chose = null;
|
||||
|
|
|
@ -210,7 +210,7 @@ public abstract class TransportResolver {
|
|||
*
|
||||
* @return the list of listeners
|
||||
*/
|
||||
public ArrayList<TransportResolverListener> getListenersList() {
|
||||
public List<TransportResolverListener> getListenersList() {
|
||||
synchronized (listeners) {
|
||||
return new ArrayList<>(listeners);
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public abstract class JingleContentDescription implements ExtensionElement {
|
|||
*
|
||||
* @return a list for the audio payloads in the packet.
|
||||
*/
|
||||
public ArrayList<JinglePayloadType> getJinglePayloadTypesList() {
|
||||
public List<JinglePayloadType> getJinglePayloadTypesList() {
|
||||
synchronized (payloads) {
|
||||
return new ArrayList<>(payloads);
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ public abstract class JingleContentDescription implements ExtensionElement {
|
|||
*
|
||||
* @return a list of PayloadType.Audio
|
||||
*/
|
||||
public ArrayList<PayloadType.Audio> getAudioPayloadTypesList() {
|
||||
public List<PayloadType.Audio> getAudioPayloadTypesList() {
|
||||
ArrayList<PayloadType.Audio> result = new ArrayList<>();
|
||||
Iterator<JinglePayloadType> jinglePtsIter = getJinglePayloadTypes();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue