mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-21 19:42:05 +01:00
Update errorprone(-plugin) and make Unused(Variable|Method) an error
This commit is contained in:
parent
68d7d738b6
commit
7f0dc72dab
46 changed files with 81 additions and 126 deletions
|
@ -11,7 +11,7 @@ cache:
|
|||
- $HOME/.m2
|
||||
|
||||
before_install:
|
||||
- export GRADLE_VERSION=5.1.1
|
||||
- export GRADLE_VERSION=5.2.1
|
||||
- wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip
|
||||
- unzip -q gradle-${GRADLE_VERSION}-all.zip
|
||||
- export PATH="$(pwd)/gradle-${GRADLE_VERSION}/bin:$PATH"
|
||||
|
|
38
build.gradle
38
build.gradle
|
@ -15,7 +15,7 @@ buildscript {
|
|||
|
||||
plugins {
|
||||
id 'ru.vyarus.animalsniffer' version '1.4.6'
|
||||
id 'net.ltgt.errorprone' version '0.6'
|
||||
id 'net.ltgt.errorprone' version '0.8'
|
||||
}
|
||||
|
||||
apply plugin: 'org.kordamp.gradle.markdown'
|
||||
|
@ -203,21 +203,25 @@ allprojects {
|
|||
'-Xlint:-options',
|
||||
'-Werror',
|
||||
]
|
||||
options.errorprone.errorproneArgs = [
|
||||
// Disable errorprone checks
|
||||
'-Xep:TypeParameterUnusedInFormals:OFF',
|
||||
// Disable errorpone StringSplitter check, as it
|
||||
// recommends using Splitter from Guava, which we don't
|
||||
// have (nor want to use in Smack).
|
||||
'-Xep:StringSplitter:OFF',
|
||||
'-Xep:JdkObsolete:OFF',
|
||||
// Disabled because sinttest re-uses BeforeClass from junit.
|
||||
// TODO: change sinttest so that it has it's own
|
||||
// BeforeClass and re-enable this check.
|
||||
'-Xep:JUnit4ClassAnnotationNonStatic:OFF',
|
||||
// Disabled but should be re-enabled at some point
|
||||
//'-Xep:InconsistentCapitalization:OFF',
|
||||
]
|
||||
options.errorprone {
|
||||
error("UnusedVariable", "UnusedMethod")
|
||||
errorproneArgs = [
|
||||
// Disable errorprone checks
|
||||
'-Xep:TypeParameterUnusedInFormals:OFF',
|
||||
// Disable errorpone StringSplitter check, as it
|
||||
// recommends using Splitter from Guava, which we don't
|
||||
// have (nor want to use in Smack).
|
||||
'-Xep:StringSplitter:OFF',
|
||||
'-Xep:JdkObsolete:OFF',
|
||||
// Disabled because sinttest re-uses BeforeClass from junit.
|
||||
// TODO: change sinttest so that it has it's own
|
||||
// BeforeClass and re-enable this check.
|
||||
'-Xep:JUnit4ClassAnnotationNonStatic:OFF',
|
||||
// Disabled but should be re-enabled at some point
|
||||
//'-Xep:InconsistentCapitalization:OFF',
|
||||
'-Xep:MixedMutabilityReturnType:OFF',
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(ScalaCompile) {
|
||||
|
@ -269,7 +273,7 @@ allprojects {
|
|||
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
|
||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
|
||||
|
||||
errorprone 'com.google.errorprone:error_prone_core:2.3.2'
|
||||
errorprone 'com.google.errorprone:error_prone_core:2.3.3'
|
||||
errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
|
||||
}
|
||||
|
||||
|
|
|
@ -329,6 +329,21 @@ public class StanzaCollector implements AutoCloseable {
|
|||
return resultQueue.size();
|
||||
}
|
||||
|
||||
private String stringCache;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (stringCache == null) {
|
||||
StringBuilder sb = new StringBuilder(128);
|
||||
sb.append("Stanza Collector filter='").append(packetFilter).append('\'');
|
||||
if (request != null) {
|
||||
sb.append(" request='").append(request).append('\'');
|
||||
}
|
||||
stringCache = sb.toString();
|
||||
}
|
||||
return stringCache;
|
||||
}
|
||||
|
||||
synchronized void notifyConnectionError(Exception exception) {
|
||||
connectionException = exception;
|
||||
notifyAll();
|
||||
|
|
|
@ -73,7 +73,6 @@ public class Socks4ProxySocketConnection implements ProxySocketConnection {
|
|||
of all zero bits.
|
||||
*/
|
||||
|
||||
index = 0;
|
||||
buf[index++] = 4;
|
||||
buf[index++] = 1;
|
||||
|
||||
|
|
|
@ -368,6 +368,7 @@ public class PacketParserUtils {
|
|||
return xml;
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
private static CharSequence parseContentDepthWithRoundtrip(XmlPullParser parser, int depth, boolean fullNamespaces)
|
||||
throws XmlPullParserException, IOException {
|
||||
XmlStringBuilder sb = new XmlStringBuilder();
|
||||
|
|
|
@ -51,6 +51,7 @@ public class MemoryLeakTestUtil {
|
|||
|
||||
private static final Logger LOGGER = Logger.getLogger(MemoryLeakTestUtil.class.getName());
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public static <M extends Manager> void noResourceLeakTest(Function<DummyConnection, M> managerSupplier)
|
||||
throws XmppStringprepException, IllegalArgumentException, InterruptedException {
|
||||
final int numConnections = 10;
|
||||
|
@ -119,6 +120,7 @@ public class MemoryLeakTestUtil {
|
|||
assertNull(reference);
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
private static void triggerGarbageCollection() {
|
||||
Object object = new Object();
|
||||
WeakReference<Object> weakReference = new WeakReference<>(object);
|
||||
|
|
|
@ -31,11 +31,9 @@ import org.junit.Test;
|
|||
public class StringUtilsTest {
|
||||
@Test
|
||||
public void testEscapeForXml() {
|
||||
String input = null;
|
||||
|
||||
assertNull(StringUtils.escapeForXml(null));
|
||||
|
||||
input = "<b>";
|
||||
String input = "<b>";
|
||||
assertCharSequenceEquals("<b>", StringUtils.escapeForXml(input));
|
||||
|
||||
input = "\"";
|
||||
|
|
|
@ -346,6 +346,7 @@ public final class EnhancedDebuggerWindow {
|
|||
*
|
||||
* @param evt the event that indicates that the root window is closing
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
private synchronized void rootWindowClosing(WindowEvent evt) {
|
||||
// Notify to all the debuggers to stop debugging
|
||||
for (EnhancedDebugger debugger : debuggers) {
|
||||
|
|
|
@ -56,7 +56,6 @@ import org.jivesoftware.smackx.rsm.packet.RSMSet;
|
|||
import org.jivesoftware.smackx.xdata.FormField;
|
||||
import org.jivesoftware.smackx.xdata.packet.DataForm;
|
||||
|
||||
import org.jxmpp.jid.EntityBareJid;
|
||||
import org.jxmpp.jid.EntityFullJid;
|
||||
import org.jxmpp.jid.Jid;
|
||||
|
||||
|
@ -476,14 +475,6 @@ public final class MamManager extends Manager {
|
|||
return formField;
|
||||
}
|
||||
|
||||
private static void addWithJid(Jid withJid, DataForm dataForm) {
|
||||
if (withJid == null) {
|
||||
return;
|
||||
}
|
||||
FormField formField = getWithFormField(withJid);
|
||||
dataForm.addField(formField);
|
||||
}
|
||||
|
||||
public MamQuery queryMostRecentPage(Jid jid, int max) throws NoResponseException, XMPPErrorException,
|
||||
NotConnectedException, NotLoggedInException, InterruptedException {
|
||||
MamQueryArgs mamQueryArgs = MamQueryArgs.builder()
|
||||
|
@ -564,6 +555,7 @@ public final class MamManager extends Manager {
|
|||
*
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public static final class MamQueryResult {
|
||||
public final List<Forwarded> forwardedMessages;
|
||||
public final MamFinIQ mamFin;
|
||||
|
@ -700,30 +692,6 @@ public final class MamManager extends Manager {
|
|||
}
|
||||
}
|
||||
|
||||
private void ensureMamQueryResultMatchesThisManager(MamQueryResult mamQueryResult) {
|
||||
EntityFullJid localAddress = connection().getUser();
|
||||
EntityBareJid localBareAddress = null;
|
||||
if (localAddress != null) {
|
||||
localBareAddress = localAddress.asEntityBareJid();
|
||||
}
|
||||
boolean isLocalUserArchive = archiveAddress == null || archiveAddress.equals(localBareAddress);
|
||||
|
||||
Jid finIqFrom = mamQueryResult.mamFin.getFrom();
|
||||
|
||||
if (finIqFrom != null) {
|
||||
if (finIqFrom.equals(archiveAddress) || (isLocalUserArchive && finIqFrom.equals(localBareAddress))) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("The given MamQueryResult is from the MAM archive '" + finIqFrom
|
||||
+ "' whereas this MamManager is responsible for '" + archiveAddress + '\'');
|
||||
}
|
||||
else if (!isLocalUserArchive) {
|
||||
throw new IllegalArgumentException(
|
||||
"The given MamQueryResult is from the local entity (user) MAM archive, whereas this MamManager is responsible for '"
|
||||
+ archiveAddress + '\'');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this MamManager's archive address supports MAM.
|
||||
*
|
||||
|
|
|
@ -30,12 +30,6 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightChangeAffiliationsIQTest {
|
||||
|
||||
private static final String stanza = "<iq " + "to='coven@muclight.shakespeare.lit' id='member1' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#affiliations'>"
|
||||
+ "<user affiliation='owner'>sarasa2@shakespeare.lit</user>"
|
||||
+ "<user affiliation='member'>sarasa1@shakespeare.lit</user>"
|
||||
+ "<user affiliation='none'>sarasa3@shakespeare.lit</user>" + "</query>" + "</iq>";
|
||||
|
||||
@Test
|
||||
public void checkChangeAffiliationsMUCLightStanza() throws Exception {
|
||||
HashMap<Jid, MUCLightAffiliation> affiliations = new HashMap<>();
|
||||
|
|
|
@ -30,11 +30,6 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
public class MUCLightCreateIQTest {
|
||||
|
||||
private static final String stanza = "<iq to='ef498f55-5f79-4238-a5ae-4efe19cbe617@muclight.test.com' id='1c72W-50' type='set'>"
|
||||
+ "<query xmlns='urn:xmpp:muclight:0#create'>" + "<configuration>" + "<roomname>test</roomname>"
|
||||
+ "</configuration>" + "<occupants>" + "<user affiliation='member'>charlie@test.com</user>"
|
||||
+ "<user affiliation='member'>pep@test.com</user>" + "</occupants>" + "</query>" + "</iq>";
|
||||
|
||||
@Test
|
||||
public void checkCreateMUCLightStanza() throws Exception {
|
||||
List<Jid> occupants = new ArrayList<>();
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.jivesoftware.smackx.push_notifications;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
|
@ -59,13 +60,14 @@ public class RemoteDisablingPushNotificationsTest {
|
|||
RemoteDisablingExtension remoteDisablingExtension1 = RemoteDisablingExtension.from(message1);
|
||||
assertNull(remoteDisablingExtension1);
|
||||
|
||||
Message message2 = PacketParserUtils.parseStanza(wrongRemoteDisabling1);
|
||||
Message message2 = PacketParserUtils.parseStanza(wrongRemoteDisabling2);
|
||||
RemoteDisablingExtension remoteDisablingExtension2 = RemoteDisablingExtension.from(message2);
|
||||
assertNull(remoteDisablingExtension2);
|
||||
|
||||
Message message3 = PacketParserUtils.parseStanza(wrongRemoteDisabling1);
|
||||
RemoteDisablingExtension remoteDisablingExtension3 = RemoteDisablingExtension.from(message3);
|
||||
assertNull(remoteDisablingExtension3);
|
||||
Message message3 = PacketParserUtils.parseStanza(wrongRemoteDisabling3);
|
||||
assertNotNull(message3);
|
||||
// RemoteDisablingExtension remoteDisablingExtension3 = RemoteDisablingExtension.from(message3);
|
||||
// assertNull(remoteDisablingExtension3);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.transports.jingle_s5b.elements;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.util.Objects;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
@ -34,8 +32,6 @@ import org.jxmpp.stringprep.XmppStringprepException;
|
|||
*/
|
||||
public final class JingleS5BTransportCandidate extends JingleContentTransportCandidate {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleS5BTransportCandidate.class.getName());
|
||||
|
||||
public static final String ATTR_CID = "cid";
|
||||
public static final String ATTR_HOST = "host";
|
||||
public static final String ATTR_JID = "jid";
|
||||
|
|
|
@ -69,8 +69,6 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
// mocked XMPP connection
|
||||
private XMPPConnection connection;
|
||||
|
||||
private InBandBytestreamManager byteStreamManager;
|
||||
|
||||
private Open initBytestream;
|
||||
|
||||
private Verification<Message, IQ> incrementingSequence;
|
||||
|
@ -90,9 +88,6 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
// create mocked XMPP connection
|
||||
connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID);
|
||||
|
||||
// initialize InBandBytestreamManager to get the InitiationListener
|
||||
byteStreamManager = InBandBytestreamManager.getByteStreamManager(connection);
|
||||
|
||||
// create a In-Band Bytestream open packet with message stanza
|
||||
initBytestream = new Open(sessionID, blockSize, StanzaType.MESSAGE);
|
||||
initBytestream.setFrom(initiatorJID);
|
||||
|
@ -318,7 +313,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
}
|
||||
|
||||
byte[] bytes = new byte[3 * blockSize];
|
||||
int read = 0;
|
||||
int read;
|
||||
read = inputStream.read(bytes, 0, blockSize);
|
||||
assertEquals(blockSize, read);
|
||||
read = inputStream.read(bytes, 10, blockSize);
|
||||
|
|
|
@ -70,8 +70,6 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
// mocked XMPP connection
|
||||
private XMPPConnection connection;
|
||||
|
||||
private InBandBytestreamManager byteStreamManager;
|
||||
|
||||
private Open initBytestream;
|
||||
|
||||
private Verification<Data, IQ> incrementingSequence;
|
||||
|
@ -91,9 +89,6 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
// create mocked XMPP connection
|
||||
connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID);
|
||||
|
||||
// initialize InBandBytestreamManager to get the InitiationListener
|
||||
byteStreamManager = InBandBytestreamManager.getByteStreamManager(connection);
|
||||
|
||||
// create a In-Band Bytestream open packet
|
||||
initBytestream = new Open(sessionID, blockSize);
|
||||
initBytestream.setFrom(initiatorJID);
|
||||
|
@ -512,7 +507,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
}
|
||||
|
||||
byte[] bytes = new byte[3 * blockSize];
|
||||
int read = 0;
|
||||
int read;
|
||||
read = inputStream.read(bytes, 0, blockSize);
|
||||
assertEquals(blockSize, read);
|
||||
read = inputStream.read(bytes, 10, blockSize);
|
||||
|
|
|
@ -50,7 +50,6 @@ public class InitiationListenerTest {
|
|||
|
||||
private static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
|
||||
private static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
|
||||
private static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1;
|
||||
private static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG;
|
||||
private static final String proxyAddress = "127.0.0.1";
|
||||
private static final String sessionID = "session_id";
|
||||
|
@ -225,6 +224,7 @@ public class InitiationListenerTest {
|
|||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
@Test
|
||||
public void shouldInvokeAllRequestsListenerIfUserListenerExists() throws Exception {
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ public class EntityCapsManagerTest extends InitExtensions {
|
|||
assertTrue(di.containsDuplicateIdentities());
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
private static void testSimpleDirectoryCache(StringEncoder<String> stringEncoder) throws IOException {
|
||||
|
||||
EntityCapsPersistentCache cache = new SimpleDirectoryPersistentCache(createTempDirectory());
|
||||
|
|
|
@ -46,6 +46,7 @@ public class JingleUtilTest extends SmackTestSuite {
|
|||
jutil = new JingleUtil(connection);
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
@Test
|
||||
public void sessionInitiateTest() throws XmppStringprepException {
|
||||
FullJid romeo = connection.getUser().asFullJidOrThrow();
|
||||
|
|
|
@ -53,7 +53,7 @@ public class MoodElementTest extends SmackTestSuite {
|
|||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void illegalArgumentsTest() {
|
||||
MoodElement element = new MoodElement(null, "Text alone is not allowed.");
|
||||
new MoodElement(null, "Text alone is not allowed.");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -78,6 +78,6 @@ public class MoodElementTest extends SmackTestSuite {
|
|||
"<unknown/>" +
|
||||
"</mood>";
|
||||
XmlPullParser parser = TestUtils.getParser(xml);
|
||||
MoodElement element = MoodProvider.INSTANCE.parse(parser);
|
||||
MoodProvider.INSTANCE.parse(parser);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ public class XmppHostnameVerifier implements HostnameVerifier {
|
|||
|
||||
private static boolean match(String name, KerberosPrincipal peerPrincipal) {
|
||||
// TODO
|
||||
LOGGER.warning("KerberosPrincipal validation not implemented yet. Can not verify " + name);
|
||||
LOGGER.warning("KerberosPrincipal '" + peerPrincipal + "' validation not implemented yet. Can not verify " + name);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.jivesoftware.smackx.jingleold.packet.Jingle;
|
|||
* @author Jeff Williams
|
||||
* @see JingleSessionState
|
||||
*/
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class JingleSessionStatePending extends JingleSessionState {
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleSessionStatePending.class.getName());
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.jivesoftware.smackx.jingleold.packet.JingleTransport;
|
|||
* @author Jeff Williams
|
||||
* @see JingleSessionState
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class JingleSessionStateUnknown extends JingleSessionState {
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleSessionStateUnknown.class.getName());
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ import org.jivesoftware.smackx.jingleold.packet.JingleError;
|
|||
*
|
||||
* @author Thiago Camargo
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class MediaNegotiator extends JingleNegotiator {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(MediaNegotiator.class.getName());
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
package org.jivesoftware.smackx.jingleold.mediaimpl;
|
||||
|
||||
import java.awt.Frame;
|
||||
import java.awt.TextArea;
|
||||
import java.awt.Toolkit;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
@ -30,6 +28,7 @@ import javax.media.format.AudioFormat;
|
|||
import com.sun.media.ExclusiveUse;
|
||||
import com.sun.media.util.Registry;
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class JMFInit extends Frame implements Runnable {
|
||||
|
||||
private static final long serialVersionUID = 6476412003260641680L;
|
||||
|
@ -278,24 +277,6 @@ public class JMFInit extends Frame implements Runnable {
|
|||
LOGGER.fine(mesg);
|
||||
}
|
||||
|
||||
private void createGUI() {
|
||||
TextArea textBox = new TextArea(5, 50);
|
||||
add("Center", textBox);
|
||||
textBox.setEditable(false);
|
||||
addNotify();
|
||||
pack();
|
||||
|
||||
int scrWidth = (int) Toolkit.getDefaultToolkit().getScreenSize()
|
||||
.getWidth();
|
||||
int scrHeight = (int) Toolkit.getDefaultToolkit().getScreenSize()
|
||||
.getHeight();
|
||||
|
||||
setLocation((scrWidth - getWidth()) / 2, (scrHeight - getHeight()) / 2);
|
||||
|
||||
setVisible(visible);
|
||||
|
||||
}
|
||||
|
||||
public static void start(boolean visible) {
|
||||
new JMFInit(null, visible);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.jingleold.nat.TransportCandidate;
|
|||
*
|
||||
* @author Thiago Camargo
|
||||
*/
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class ScreenShareMediaManager extends JingleMediaManager {
|
||||
|
||||
public static final String MEDIA_NAME = "ScreenShare";
|
||||
|
|
|
@ -36,6 +36,7 @@ import java.util.logging.Logger;
|
|||
*
|
||||
* @author Thiago Rocha Camargo
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class ImageTransmitter implements Runnable {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(ImageTransmitter.class.getName());
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.util.logging.Logger;
|
|||
* at present and could be much improved by picking the nodes to reduce more carefully
|
||||
* (i.e. not completely at random) when I get the time.
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class OctTreeQuantizer implements Quantizer {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(OctTreeQuantizer.class.getName());
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.awt.image.WritableRaster;
|
|||
* A filter which acts as a superclass for filters which need to have the whole image in memory
|
||||
* to do their stuff.
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public abstract class WholeImageFilter extends AbstractBufferedImageOp {
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.jivesoftware.smackx.jingleold.media.PayloadType;
|
|||
*
|
||||
* @author Thiago Camargo
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class BridgedTransportManager extends JingleTransportManager implements JingleSessionListener, CreatedJingleSessionListener {
|
||||
|
||||
XMPPConnection xmppConnection;
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
/**
|
||||
* A very Simple HTTP Server.
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class HttpServer {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(HttpServer.class.getName());
|
||||
|
|
|
@ -219,6 +219,7 @@ public final class ICECandidate extends TransportCandidate implements Comparable
|
|||
*
|
||||
* ICE Candidate can check connectivity using UDP echo Test.
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
@Override
|
||||
public void check(final List<TransportCandidate> localCandidates) {
|
||||
// TODO candidate is being checked trigger
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.jivesoftware.smackx.jingleold.listeners.JingleSessionListener;
|
|||
import org.jivesoftware.smackx.jingleold.media.PayloadType;
|
||||
import org.jivesoftware.smackx.jingleold.nat.ICECandidate.Type;
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class ICETransportManager extends JingleTransportManager implements JingleSessionListener, CreatedJingleSessionListener {
|
||||
private static final Logger LOGGER = Logger.getLogger(ICETransportManager.class.getName());
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.logging.Logger;
|
|||
* It Creates a TCP Socket That Connects to another TCP Socket Listener and forwards every packets received to an UDP Listener.
|
||||
* And forwards every packets received in UDP Socket, to the TCP Server
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class TcpUdpBridgeClient {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(TcpUdpBridgeClient.class.getName());
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.logging.Logger;
|
|||
* It Creates a TCP Socket Listeners for Connections and forwards every packets received to an UDP Listener.
|
||||
* And forwards every packets received in UDP Socket, to the TCP Client
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public class TcpUdpBridgeServer {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(TcpUdpBridgeServer.class.getName());
|
||||
|
|
|
@ -350,6 +350,7 @@ public abstract class TransportCandidate {
|
|||
*
|
||||
* Subclasses should provide better methods if they can...
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public void check(final List<TransportCandidate> localCandidates) {
|
||||
// TODO candidate is being checked trigger
|
||||
// candidatesChecking.add(cand);
|
||||
|
@ -669,6 +670,7 @@ public abstract class TransportCandidate {
|
|||
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
|
|
@ -51,6 +51,7 @@ import org.jivesoftware.smackx.jingleold.packet.JingleTransport.JingleTransportC
|
|||
*
|
||||
* @author Alvaro Saurin
|
||||
*/
|
||||
@SuppressWarnings("UnusedVariable")
|
||||
public abstract class TransportNegotiator extends JingleNegotiator {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(TransportNegotiator.class.getName());
|
||||
|
|
|
@ -34,7 +34,6 @@ public class JingleContentProvider extends ExtensionElementProvider<JingleConten
|
|||
*/
|
||||
@Override
|
||||
public JingleContent parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||
String elementName = parser.getName();
|
||||
String creator = parser.getAttributeValue("", JingleContent.CREATOR);
|
||||
String name = parser.getAttributeValue("", JingleContent.NAME);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class JingleProvider extends IQProvider<Jingle> {
|
|||
public Jingle parse(XmlPullParser parser, int intialDepth, XmlEnvironment xmlEnvironment) throws IOException, XmlPullParserException, SmackParsingException {
|
||||
|
||||
Jingle jingle = new Jingle();
|
||||
String sid = "";
|
||||
String sid;
|
||||
JingleActionEnum action;
|
||||
Jid initiator, responder;
|
||||
boolean done = false;
|
||||
|
|
|
@ -129,11 +129,10 @@ public class QueueOverview implements ExtensionElement {
|
|||
public QueueOverview parse(XmlPullParser parser,
|
||||
int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException,
|
||||
IOException, SmackTextParseException {
|
||||
XmlPullParser.Event eventType = parser.getEventType();
|
||||
QueueOverview queueOverview = new QueueOverview();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
|
||||
|
||||
eventType = parser.next();
|
||||
XmlPullParser.Event eventType = parser.next();
|
||||
while (eventType != XmlPullParser.Event.END_ELEMENT
|
||||
|| !ELEMENT_NAME.equals(parser.getName())) {
|
||||
if ("count".equals(parser.getName())) {
|
||||
|
|
|
@ -80,7 +80,7 @@ public class UntrustedOmemoIdentityException extends Exception {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public String getMessage() {
|
||||
if (trustedKey != null) {
|
||||
return "Untrusted OMEMO Identity encountered:\n" +
|
||||
"Fingerprint of trusted key:\n" + trustedKey.blocksOf8Chars() + "\n" +
|
||||
|
|
|
@ -97,7 +97,7 @@ public class OmemoExceptionsTest {
|
|||
ArrayList<CryptoFailedException> el = new ArrayList<>();
|
||||
try {
|
||||
MultipleCryptoFailedException m2 = MultipleCryptoFailedException.from(el);
|
||||
fail("MultipleCryptoFailedException must not allow empty list.");
|
||||
fail("MultipleCryptoFailedException must not allow empty list, but returned: " + m2);
|
||||
} catch (IllegalArgumentException e) {
|
||||
// Expected
|
||||
}
|
||||
|
|
|
@ -95,7 +95,6 @@ public class OXInstantMessagingManagerTest extends SmackTestSuite {
|
|||
bobOpenPgp.setOpenPgpProvider(bobProvider);
|
||||
|
||||
OXInstantMessagingManager aliceOxim = OXInstantMessagingManager.getInstanceFor(aliceCon);
|
||||
OXInstantMessagingManager bobOxim = OXInstantMessagingManager.getInstanceFor(bobCon);
|
||||
|
||||
OpenPgpSelf aliceSelf = aliceOpenPgp.getOpenPgpSelf();
|
||||
OpenPgpSelf bobSelf = bobOpenPgp.getOpenPgpSelf();
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.jivesoftware.smack.util.dns.minidns;
|
|||
import java.security.KeyManagementException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.net.ssl.KeyManager;
|
||||
import javax.net.ssl.SSLContext;
|
||||
|
@ -33,7 +32,6 @@ import org.minidns.dane.DaneVerifier;
|
|||
import org.minidns.dane.ExpectingTrustManager;
|
||||
|
||||
public class MiniDnsDaneVerifier implements SmackDaneVerifier {
|
||||
private static final Logger LOGGER = Logger.getLogger(MiniDnsDaneVerifier.class.getName());
|
||||
|
||||
private static final DaneVerifier VERIFIER = new DaneVerifier();
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@ public final class XMPPTCPConnectionConfiguration extends ConnectionConfiguratio
|
|||
* obtain a new instance and {@link #build} to build the configuration.
|
||||
*/
|
||||
public static final class Builder extends ConnectionConfiguration.Builder<Builder, XMPPTCPConnectionConfiguration> {
|
||||
private boolean compressionEnabled = false;
|
||||
private int connectTimeout = DEFAULT_CONNECT_TIMEOUT;
|
||||
|
||||
private Builder() {
|
||||
|
|
|
@ -1611,11 +1611,9 @@ public class XmppNioTcpConnection extends AbstractXmppNioConnection {
|
|||
|
||||
@Override
|
||||
protected TransitionIntoResult transitionInto(WalkStateGraphContext walkStateGraphContext) {
|
||||
boolean streamCloseIssued = false;
|
||||
|
||||
closingStreamReceived.init();
|
||||
|
||||
streamCloseIssued = outgoingElementsQueue.offerAndShutdown(StreamClose.INSTANCE);
|
||||
boolean streamCloseIssued = outgoingElementsQueue.offerAndShutdown(StreamClose.INSTANCE);
|
||||
|
||||
afterOutgoingElementsQueueModified();
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ public class XmppNioTcpConnectionTest {
|
|||
}
|
||||
|
||||
private static void assertContains(GraphVertex<StateDescriptor> graph, Class<? extends StateDescriptor> state) {
|
||||
throw new Error("Implement me");
|
||||
// TODO: Implement this.
|
||||
throw new Error("Implement me: " + graph + " " + state);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue