1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Bump "Error Prone" to 2.3.2

and gradle-errorprone-plugin to 0.6.
This commit is contained in:
Florian Schmaus 2018-10-31 16:06:31 +01:00
parent ec7badfda0
commit b7ea226c56
65 changed files with 173 additions and 149 deletions

View file

@ -230,12 +230,12 @@ public class ContentNegotiator extends JingleNegotiator {
boolean result = true;
MediaNegotiator mediaNeg = getMediaNegotiator();
if ((mediaNeg == null) || (!mediaNeg.isFullyEstablished())) {
if ((mediaNeg == null) || !mediaNeg.isFullyEstablished()) {
result = false;
}
TransportNegotiator transNeg = getTransportNegotiator();
if ((transNeg == null) || (!transNeg.isFullyEstablished())) {
if ((transNeg == null) || !transNeg.isFullyEstablished()) {
result = false;
}

View file

@ -62,7 +62,7 @@ import org.jxmpp.jid.Jid;
* @author Alvaro Saurin
* @author Jeff Williams
*/
public class JingleSession extends JingleNegotiator implements MediaReceivedListener {
public final class JingleSession extends JingleNegotiator implements MediaReceivedListener {
private static final Logger LOGGER = Logger.getLogger(JingleSession.class.getName());
@ -235,7 +235,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
* Generate a unique session ID.
*/
protected static String generateSessionId() {
return String.valueOf(Math.abs(randomGenerator.nextLong()));
return String.valueOf(randomGenerator.nextInt(Integer.MAX_VALUE) + randomGenerator.nextInt(Integer.MAX_VALUE));
}
/**
@ -478,7 +478,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
// The the packet.
// CHECKSTYLE:OFF
if ((getConnection() != null) && (getConnection().isConnected()))
if ((getConnection() != null) && getConnection().isConnected())
getConnection().sendStanza(jout);
// CHECKSTYLE:ON
}

View file

@ -172,7 +172,7 @@ public class PayloadType {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
if (!(obj instanceof PayloadType)) {
return false;
}
final PayloadType other = (PayloadType) obj;
@ -244,7 +244,7 @@ public class PayloadType {
/**
* Audio payload type.
*/
public static class Audio extends PayloadType {
public static final class Audio extends PayloadType {
private int clockRate;

View file

@ -78,7 +78,7 @@ public class ScreenShareSession extends JingleMediaSession {
public void initialize() {
JingleSession session = getJingleSession();
if ((session != null) && (session.getInitiator().equals(session.getConnection().getUser()))) {
if (session != null && session.getInitiator().equals(session.getConnection().getUser())) {
// If the initiator of the jingle session is us then we transmit a screen share.
try {
InetAddress remote = InetAddress.getByName(getRemote().getIp());

View file

@ -73,7 +73,7 @@ public class BridgedResolver extends TransportResolver {
clearCandidates();
sid = Math.abs(random.nextLong());
sid = random.nextInt(Integer.MAX_VALUE);
RTPBridge rtpBridge = RTPBridge.getRTPBridge(connection, String.valueOf(sid));

View file

@ -30,7 +30,7 @@ import java.util.logging.Logger;
*
* @author Thiago Camargo
*/
public class ICECandidate extends TransportCandidate implements Comparable<ICECandidate> {
public final class ICECandidate extends TransportCandidate implements Comparable<ICECandidate> {
private static final Logger LOGGER = Logger.getLogger(ICECandidate.class.getName());

View file

@ -145,7 +145,7 @@ public class ICEResolver extends TransportResolver {
LOGGER.log(Level.WARNING, "exeption", e1);
}
TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress().getHostAddress(), 1, nicNum, String.valueOf(Math.abs(random.nextLong())), candidate.getPort(), "1", candidate.getPriority(), iceType);
TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress().getHostAddress(), 1, nicNum, String.valueOf(random.nextInt(Integer.MAX_VALUE)), candidate.getPort(), "1", candidate.getPriority(), iceType);
transportCandidate.setLocalIp(candidate.getBase().getAddress().getInetAddress().getHostAddress());
transportCandidate.setPort(getFreePort());
try {
@ -186,16 +186,16 @@ public class ICEResolver extends TransportResolver {
network = 0;
}
sid = Math.abs(random.nextLong());
sid = random.nextInt(Integer.MAX_VALUE);
RTPBridge rtpBridge = RTPBridge.getRTPBridge(connection, String.valueOf(sid));
TransportCandidate localCandidate = new ICECandidate(
rtpBridge.getIp(), 1, network, String.valueOf(Math.abs(random.nextLong())), rtpBridge.getPortA(), "1", 0, ICECandidate.Type.relay);
rtpBridge.getIp(), 1, network, String.valueOf(random.nextInt(Integer.MAX_VALUE)), rtpBridge.getPortA(), "1", 0, ICECandidate.Type.relay);
localCandidate.setLocalIp(localIp);
TransportCandidate remoteCandidate = new ICECandidate(
rtpBridge.getIp(), 1, network, String.valueOf(Math.abs(random.nextLong())), rtpBridge.getPortB(), "1", 0, ICECandidate.Type.relay);
rtpBridge.getIp(), 1, network, String.valueOf(random.nextInt(Integer.MAX_VALUE)), rtpBridge.getPortB(), "1", 0, ICECandidate.Type.relay);
remoteCandidate.setLocalIp(localIp);
localCandidate.setSymmetric(remoteCandidate);
@ -260,7 +260,7 @@ public class ICEResolver extends TransportResolver {
if (!found) {
try {
TransportCandidate publicCandidate = new ICECandidate(
publicIp, 1, 0, String.valueOf(Math.abs(random.nextLong())), getFreePort(), "1", 0, ICECandidate.Type.srflx);
publicIp, 1, 0, String.valueOf(random.nextInt(Integer.MAX_VALUE)), getFreePort(), "1", 0, ICECandidate.Type.srflx);
publicCandidate.setLocalIp(InetAddress.getLocalHost().getHostAddress());
try {

View file

@ -447,7 +447,7 @@ public class RTPBridge extends IQ {
DiscoverInfo discoInfo = disco.discoverInfo(connection.getXMPPServiceDomain());
for (DiscoverInfo.Identity identity : discoInfo.getIdentities()) {
if ((identity.getName() != null) && (identity.getName().startsWith("rtpbridge"))) {
if (identity.getName() != null && identity.getName().startsWith("rtpbridge")) {
return true;
}
}

View file

@ -309,7 +309,7 @@ public abstract class TransportCandidate {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
if (!(obj instanceof TransportCandidate)) {
return false;
}
final TransportCandidate other = (TransportCandidate) obj;
@ -447,7 +447,7 @@ public abstract class TransportCandidate {
/**
* Type-safe enum for the transportElement protocol.
*/
public static class Protocol {
public static final class Protocol {
public static final Protocol UDP = new Protocol("udp");
@ -584,7 +584,7 @@ public abstract class TransportCandidate {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
if (!(obj instanceof Channel)) {
return false;
}
final Channel other = (Channel) obj;

View file

@ -317,8 +317,8 @@ public abstract class TransportNegotiator extends JingleNegotiator {
TransportCandidate bestRemote = getBestRemoteCandidate();
// State state = getState();
if ((bestRemote != null)
&& ((getNegotiatorState() == JingleNegotiatorState.PENDING))) {
if (bestRemote != null
&& getNegotiatorState() == JingleNegotiatorState.PENDING) {
// Accepting the remote candidate
if (!acceptedRemoteCandidates.contains(bestRemote)) {
Jingle jout = new Jingle(JingleActionEnum.CONTENT_ACCEPT);
@ -335,7 +335,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
}
acceptedRemoteCandidates.add(bestRemote);
}
if ((isEstablished()) && (getNegotiatorState() == JingleNegotiatorState.PENDING)) {
if (isEstablished() && getNegotiatorState() == JingleNegotiatorState.PENDING) {
setNegotiatorState(JingleNegotiatorState.SUCCEEDED);
try {
triggerTransportEstablished(getAcceptedLocalCandidate(), bestRemote);
@ -409,8 +409,8 @@ public abstract class TransportNegotiator extends JingleNegotiator {
bestRemote = getBestRemoteCandidate();
// State state = getState();
if ((bestRemote != null)
&& ((getNegotiatorState() == JingleNegotiatorState.PENDING))) {
if (bestRemote != null
&& getNegotiatorState() == JingleNegotiatorState.PENDING) {
if (!acceptedRemoteCandidates.contains(bestRemote)) {
Jingle jout = new Jingle(JingleActionEnum.CONTENT_ACCEPT);
JingleContent content = parentNegotiator.getJingleContent();